aboutsummaryrefslogtreecommitdiff
path: root/modules/media/torrent.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/media/torrent.nix')
-rw-r--r--modules/media/torrent.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/media/torrent.nix b/modules/media/torrent.nix
new file mode 100644
index 0000000..9fd0b96
--- /dev/null
+++ b/modules/media/torrent.nix
@@ -0,0 +1,39 @@
+{ pkgs, ... }:
+let
+ config = import ./config.nix;
+in
+{
+ environment.systemPackages = with pkgs; [
+ tremc
+ ];
+
+ services.transmission = {
+ enable = true;
+ group = config.group;
+ openRPCPort = true;
+ settings = {
+ "download-dir" = config.downloadsDir;
+ "download-queue-enabled" = true;
+ "download-queue-size" = 5;
+ "peer-port" = 51413;
+ "peer-port-random-high" = 65535;
+ "peer-port-random-low" = 49152;
+ "prefetch-enabled" = true;
+ "rename-partial-files" = true;
+ "rpc-authentication-required" = false;
+ "rpc-bind-address" = "0.0.0.0";
+ "rpc-enabled" = true;
+ "rpc-port" = config.transmissionPort;
+ "rpc-whitelist-enabled" = false;
+ "script-torrent-done-enabled" = false;
+ "start-added-torrents" = true;
+ "trash-original-torrent-files" = false;
+ "umask" = 18;
+ "utp-enabled" = true;
+ };
+ };
+
+ systemd.services.transmission.unitConfig = {
+ RequiresMountsFor = config.mediaBaseDir;
+ };
+}