{ config, lib, pkgs, ... }: { environment.systemPackages = with pkgs; [ libnatpmp gawk dig ]; systemd.services = { # wireguard-mullvad = { # bindsTo = [ "netns@torrent.service" ]; # after = [ "netns@torrent.service" ]; # }; wireguard-proton = { bindsTo = [ "netns@torrent.service" ]; after = [ "netns@torrent.service" ]; }; rtorrent = { bindsTo = [ "wireguard-proton.service" ]; after = [ "wireguard-proton.service" ]; unitConfig.JoinsNamespaceOf = "netns@torrent.service"; serviceConfig = { PrivateNetwork = true; LimitNOFILE = 24000; }; path = with pkgs; [ libnatpmp gawk dig findutils gzip ]; }; }; networking.wireguard.interfaces = { # mullvad = { # Caring Wasp # ips = [ "10.67.4.3/32" "fc00:bbbb:bbbb:bb01::4:402/128" ]; # privateKeyFile = "/root/wireguard/privkey"; # interfaceNamespace = "mullvad"; # peers = [ # # { # de-fra-wg-006.relays.mullvad.net # # publicKey = "nAF0wrLG2+avwQfqxnXhBGPUBCvc3QCqWKH4nK5PfEU="; # # endpoint = "185.209.196.76:51820"; # # allowedIPs = [ "0.0.0.0/0" "::/0" ]; # # } # { # de-fra-wg-008.relays.mullvad.net # publicKey = "TOS3U/dJPzPnk/qsAx6gHxRVIC2wI5l+tAWaJY2mXzY="; # endpoint = "185.209.196.78:51820"; # allowedIPs = [ "0.0.0.0/0" "::/0" ]; # } # ]; # }; proton = { # phaenn ips = [ "10.2.0.2/32" ]; # privateKeyFile = "/root/wireguard/proton.key"; privateKeyFile = "/root/wireguard/proton_ch.key"; interfaceNamespace = "torrent"; peers = [ # { # DE#348 # publicKey = "hOoBBy//7mddXPz1SybzWB3zK95SQCcPyI/DmxfULXk="; # endpoint = "149.88.102.97:51820"; # allowedIPs = [ "0.0.0.0/0" ]; # persistentKeepalive = 25; # } { # CH#403 publicKey = "R8TfZYSkUM30soIPOVpNsP35qCnnJvJJI9r/VxH5TkQ="; endpoint = "146.70.226.226:51820"; allowedIPs = [ "0.0.0.0/0" ]; persistentKeepalive = 25; } ]; }; }; services.rtorrent = { enable = true; package = pkgs.unstable.rtorrent.overrideAttrs (prev: { configureFlags = [ "--with-xmlrpc-c" "--with-posix-fallocate" ]; buildInputs = prev.buildInputs ++ [ pkgs.xmlrpc_c ]; }); # dataDir = "/mnt/media/download"; user = "media"; group = "media"; configText = lib.mkForce (lib.readFile ./rtorrent.rc); }; }