diff options
| author | Max Audron <audron@cocaine.farm> | 2024-02-07 14:46:29 +0000 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2024-02-07 17:27:40 +0000 |
| commit | 44ee565dfcf908df660751351d00caeb2ba39bc8 (patch) | |
| tree | 43a11284abc04d0657901f56e579dd86166814da /modules/tlmp/rtorrent.nix | |
| parent | update authentik (diff) | |
migrate tlmp setup to nixos
Diffstat (limited to 'modules/tlmp/rtorrent.nix')
| -rw-r--r-- | modules/tlmp/rtorrent.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/tlmp/rtorrent.nix b/modules/tlmp/rtorrent.nix new file mode 100644 index 0000000..bf72a2a --- /dev/null +++ b/modules/tlmp/rtorrent.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +{ + systemd.services = { + wireguard-mullvad = { + bindsTo = [ "netns@mullvad.service" ]; + after = [ "netns@mullvad.service" ]; + }; + + rtorrent = { + bindsTo = [ "wireguard-mullvad.service" ]; + after = [ "wireguard-mullvad.service" ]; + unitConfig.JoinsNamespaceOf = "netns@mullvad.service"; + serviceConfig.PrivateNetwork = true; + }; + }; + + 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" ]; + } + ]; + }; + }; + + services.rtorrent = { + enable = true; + # dataDir = "/mnt/media/download"; + user = "media"; + group = "media"; + + configText = lib.mkForce (lib.readFile ./rtorrent.rc); + }; +} |
