{ pkgs, lib, config, ... }: let inherit (config.services) transmission; inherit (config.users) users; in { users.groups.transmission.members = [ users."julm".name ]; networking.nftables.ruleset = '' add rule inet filter net2fw tcp dport ${toString transmission.settings.peer-port} counter accept comment "Transmission" add rule inet filter net2fw udp dport ${toString transmission.settings.peer-port} counter accept comment "Transmission" add rule inet filter fw2net meta skuid ${transmission.user} counter accept comment "Transmission" ''; services.transmission = { enable = true; settings = { message-level = 4; download-dir = "Downloads"; incomplete-dir-enabled = false; trash-original-torrent-files = false; preallocation = 0; umask = 63; peer-port = 6882; peer-port-random-on-start = false; encryption = 1; dht-enabled = true; lpd-enabled = false; pex-enabled = true; port-forwarding-enabled = true; scrape-paused-torrents-enabled = false; peer-socket-tos = "lowcost"; queue-stalled-enabled = true; queue-stalled-minutes = 30; speed-limit-up = 50; speed-limit-up-enabled = true; alt-speed-enabled = true; alt-speed-time-enabled = true; alt-speed-down = 0; alt-speed-up = 0; alt-speed-time-day = 127; # all days. 65; # weekend only alt-speed-time-begin = 360; # 06h00 local time alt-speed-time-end = 1320; # 22h00 local time ratio-limit = 3; ratio-limit-enabled = true; rpc-enabled = true; rpc-bind-address = "127.0.0.1"; rpc-port = 9091; rpc-whitelist = "127.0.0.1"; rpc-whitelist-enabled = true; #rpc-authentication-required = true; }; }; }