about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hosts/common/nas.nix8
-rw-r--r--hosts/common/server/transmission.nix28
2 files changed, 36 insertions, 0 deletions
diff --git a/hosts/common/nas.nix b/hosts/common/nas.nix
index 0554d40..4b41e64 100644
--- a/hosts/common/nas.nix
+++ b/hosts/common/nas.nix
@@ -7,5 +7,13 @@
     ./server/prometheus.nix
     ./server/grafana.nix
     ./server/traefik.nix
+    ./server/transmission.nix
   ];
+
+  users.groups.nas.gid = 5000;
+  users.users.nas = {
+    uid = 5000;
+    group = "nas";
+    isSystemUser = true;
+  };
 }
diff --git a/hosts/common/server/transmission.nix b/hosts/common/server/transmission.nix
new file mode 100644
index 0000000..b32697e
--- /dev/null
+++ b/hosts/common/server/transmission.nix
@@ -0,0 +1,28 @@
+{ config, lib, pkgs, ... }:
+
+{
+  services.transmission = {
+    enable = true;
+    group = "nas";
+    performanceNetParameters = true;
+    home = "/data/fast/torrents";
+    settings = {
+      dht-enabled = false;
+      cache-size-mb = 128;
+      peer-port = 52213;
+      peer-port-random-low = 49152;
+      peer-port-random-high = 65535;
+      message-level = 2;
+
+      rpc-enabled = true;
+      rpc-whitelist-enabled = true;
+      rpc-whitelist = "127.0.0.1";
+      verify-threads = 4;
+    };
+  };
+
+  networking.firewall = {
+    allowedTCPPorts = [ 52213 ];
+    allowedUDPPorts = [ 52213 ];
+  };
+}