1 { pkgs, lib, config, ... }:
3 inherit (config.services) transmission;
4 inherit (config.users) users;
5 inherit (config.security) pass;
8 users.groups.transmission.members = [
11 networking.nftables.ruleset = ''
12 add rule inet filter net2fw tcp dport ${toString transmission.settings.peer-port} counter accept comment "Transmission"
13 add rule inet filter net2fw udp dport ${toString transmission.settings.peer-port} counter accept comment "Transmission"
14 add rule inet filter fw2net meta skuid ${transmission.user} counter accept comment "Transmission"
16 security.pass.secrets."transmission/settings.json" = {};
17 systemd.services.transmission = {
18 after = [ pass.secrets."transmission/settings.json".service ];
19 requires = [ pass.secrets."transmission/settings.json".service ];
21 services.transmission = {
23 credentialsFile = pass.secrets."transmission/settings.json".path;
26 download-dir = "Downloads";
27 incomplete-dir-enabled = false;
28 trash-original-torrent-files = false;
33 peer-port-random-on-start = false;
38 port-forwarding-enabled = true;
39 scrape-paused-torrents-enabled = false;
40 peer-socket-tos = "lowcost";
41 queue-stalled-enabled = true;
42 queue-stalled-minutes = 30;
45 speed-limit-up-enabled = true;
46 alt-speed-enabled = true;
47 alt-speed-time-enabled = true;
50 alt-speed-time-day = 127; # all days. 65; # weekend only
51 alt-speed-time-begin = 360; # 06h00 local time
52 alt-speed-time-end = 1320; # 22h00 local time
54 ratio-limit-enabled = true;
57 rpc-bind-address = "127.0.0.1";
59 rpc-whitelist = "127.0.0.1";
60 rpc-whitelist-enabled = true;
61 #rpc-authentication-required = true;