diff --git a/.gitattributes b/.gitattributes index 37dc6c6..89340db 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,4 @@ secrets/matrix_reg_token filter=git-crypt diff=git-crypt secrets/owntracks_caddy_auth filter=git-crypt diff=git-crypt secrets/secureboot.tar filter=git-crypt diff=git-crypt secrets/zfs-key filter=git-crypt diff=git-crypt +secrets/slskd_env filter=git-crypt diff=git-crypt diff --git a/configuration.nix b/configuration.nix index 9ea7b67..15cbb9a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -12,6 +12,7 @@ imports = [ ./hardware.nix ./zfs.nix + ./services/postgresql.nix ./services/jellyfin.nix ./services/caddy.nix @@ -23,6 +24,7 @@ ./services/bitmagnet.nix ./services/matrix.nix ./services/owntracks.nix + ./services/soulseek.nix ]; systemd.targets = { @@ -337,9 +339,9 @@ # }; # }; - systemd.tmpfiles.rules = [ - "d /tank/music 775 ${username} users" - ]; + # systemd.tmpfiles.rules = [ + # "d /tank/music 775 ${username} users" + # ]; system.stateVersion = "24.11"; } diff --git a/flake.lock b/flake.lock index 155de25..bdcedc3 100644 --- a/flake.lock +++ b/flake.lock @@ -135,11 +135,11 @@ ] }, "locked": { - "lastModified": 1739757849, - "narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=", + "lastModified": 1742234739, + "narHash": "sha256-zFL6zsf/5OztR1NSNQF33dvS1fL/BzVUjabZq4qrtY4=", "owner": "nix-community", "repo": "home-manager", - "rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe", + "rev": "f6af7280a3390e65c2ad8fd059cdc303426cbd59", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1742003385, - "narHash": "sha256-c9gUL+HaIth47YUZTiXgG3NDhaxriJxHM7a0TEXAuBQ=", + "lastModified": 1742262784, + "narHash": "sha256-a/Knvms22n1Co7TR5uXW+gvpIZcmNWxzm7oUM+Unyok=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "9f51cce843d03d7456b535aeabca87db1012da2c", + "rev": "b72f0bc3698833e2d079fce2edf5bda04d411287", "type": "github" }, "original": { @@ -214,11 +214,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742139335, - "narHash": "sha256-r8MlAuCJxIYb0fvNLYdVr78f4saYtGyWKj47sEv9chM=", + "lastModified": 1742268799, + "narHash": "sha256-IhnK4LhkBlf14/F8THvUy3xi/TxSQkp9hikfDZRD4Ic=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e1361b38d11a95b86a3663a32201dcd3d6392b7e", + "rev": "da044451c6a70518db5b730fe277b70f494188f1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d4805e0..3113d0e 100644 --- a/flake.nix +++ b/flake.nix @@ -53,6 +53,7 @@ zpool_hdds = "hdds"; torrents_path = "/torrents"; services_dir = "/${zpool_ssds}/services"; + music_dir = "/${zpool_ssds}/music"; torrent_group = "media"; # TODO: add checks to make sure none of these collide @@ -65,10 +66,13 @@ owntracks = 3825; gitea = 2283; immich = 2284; + soulseek_web = 5030; + soulseek_listen = 50300; }; https = { certs = services_dir + "/http_certs"; + # TODO! generate website from repo directly using hugo data_dir = services_dir + "/http"; domain = "gardling.com"; wg_ip = "192.168.15.1"; diff --git a/secrets/slskd_env b/secrets/slskd_env new file mode 100644 index 0000000..b0fc466 Binary files /dev/null and b/secrets/slskd_env differ diff --git a/services/qbittorrent.nix b/services/qbittorrent.nix index b7aef5a..a716648 100644 --- a/services/qbittorrent.nix +++ b/services/qbittorrent.nix @@ -78,6 +78,21 @@ "udp://p4p.arenabg.com:1337/announce" "udp://tracker.dler.com:6969/announce" "udp://inferno.demonoid.is:3391/announce" + + "udp://tracker.torrent.eu.org:451/announce" + "udp://tracker.ololosh.space:6969/announce" + "udp://ns-1.x-fins.com:6969/announce" + "udp://leet-tracker.moe:1337/announce" + "http://tracker.vanitycore.co:6969/announce" + "http://tracker.sbsub.com:2710/announce" + "http://tracker.moxing.party:6969/announce" + "http://tracker.ipv6tracker.org:80/announce" + "http://tracker.corpscorp.online:80/announce" + "http://shubt.net:2710/announce" + "http://share.hkg-fansub.info:80/announce.php" + "http://servandroidkino.ru:80/announce" + "http://bt.poletracker.org:2710/announce" + "http://0d.kebhana.mx:443/announce" ] ); }; diff --git a/services/soulseek.nix b/services/soulseek.nix new file mode 100644 index 0000000..ae8e967 --- /dev/null +++ b/services/soulseek.nix @@ -0,0 +1,56 @@ +{ + pkgs, + config, + lib, + service_configs, + username, + ... +}: +{ + users.groups."music" = { }; + + services.slskd = { + enable = true; + domain = null; # null so we don't use nginx reverse proxy + environmentFile = ../secrets/slskd_env; + + settings = { + web = { + port = service_configs.ports.soulseek_web; + }; + soulseek = { + # description = "smth idk"; + listen_port = service_configs.ports.soulseek_listen; + }; + + shares = { + directories = [ service_configs.music_dir ]; + }; + + global = { + download = { + slots = 10; + speed_limit = 1000; + }; + upload = { + slots = 10; + speed_limit = 1000; + }; + }; + }; + }; + + users.users.${config.services.slskd.user}.extraGroups = [ "music" ]; + users.users.${config.services.jellyfin.user}.extraGroups = [ "music" ]; + + systemd.tmpfiles.rules = [ + "d ${service_configs.music_dir} 0750 ${username} music" + "d ${service_configs.music_dir} 0750 ${username} music" + ]; + + services.caddy.virtualHosts."soulseek.${service_configs.https.domain}".extraConfig = '' + # tls internal + ${builtins.readFile ../secrets/caddy_auth} + reverse_proxy :${builtins.toString config.services.slskd.settings.web.port} + ''; +}