From f767737de335f27b488d97901d20cb1dab37f7b0 Mon Sep 17 00:00:00 2001 From: Infinidoge Date: Fri, 24 Jan 2025 21:38:22 -0500 Subject: [PATCH] Infini-DL360/torrenting: init Not complete yet, needs a proper working vpn setup, but the base is there --- hosts/Infini-DL360/default.nix | 1 + hosts/Infini-DL360/torrenting.nix | 50 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 hosts/Infini-DL360/torrenting.nix diff --git a/hosts/Infini-DL360/default.nix b/hosts/Infini-DL360/default.nix index de2b631..cd2e9d7 100644 --- a/hosts/Infini-DL360/default.nix +++ b/hosts/Infini-DL360/default.nix @@ -21,6 +21,7 @@ ./searx.nix ./ssh.nix ./thelounge.nix + ./torrenting.nix ./vaultwarden.nix ]; diff --git a/hosts/Infini-DL360/torrenting.nix b/hosts/Infini-DL360/torrenting.nix new file mode 100644 index 0000000..8dca7c2 --- /dev/null +++ b/hosts/Infini-DL360/torrenting.nix @@ -0,0 +1,50 @@ +{ pkgs, private, config, lib, ... }: + +{ + containers.torrenting = { + autoStart = true; + enableTun = true; + ephemeral = true; + privateNetwork = true; + hostAddress = "192.168.1.1"; + localAddress = "192.169.1.2"; + + forwardPorts = [ + { hostPort = 9091; } + ]; + + bindMounts = { + ${config.secrets.ovpn} = { }; + }; + + config = { + system.stateVersion = "25.05"; + nixpkgs.pkgs = pkgs; # Reuse system nixpkgs + + networking.useHostResolvConf = lib.mkForce false; + services.resolved.enable = true; + + services.openvpn.servers.openvpn = { + config = '' + config ${private.files.ovpn} + auth-user-pass ${config.secrets.ovpn} + ''; + }; + + systemd.services.transmission.serviceConfig = { + RootDirectoryStartOnly = lib.mkForce false; + RootDirectory = lib.mkForce ""; + }; + + services.transmission = { + enable = true; + openRPCPort = true; + openPeerPorts = true; + settings = { + rpc-bind-address = "0.0.0.0"; + rpc-whitelist-enabled = false; + }; + }; + }; + }; +}