]> Git — Sourcephile - sourcephile-nix.git/blob - servers/losurdo/transmission.nix
apparmor: improve the service
[sourcephile-nix.git] / servers / losurdo / transmission.nix
1 { pkgs, lib, config, ... }:
2 let
3 inherit (config.services) transmission;
4 inherit (config.users) users;
5 in
6 {
7 users.groups.transmission.members = [
8 users."julm".name
9 ];
10 networking.nftables.ruleset = ''
11 add rule inet filter net2fw tcp dport ${toString transmission.settings.peer-port} counter accept comment "Transmission"
12 add rule inet filter net2fw udp dport ${toString transmission.settings.peer-port} counter accept comment "Transmission"
13 add rule inet filter fw2net meta skuid ${transmission.user} counter accept comment "Transmission"
14 '';
15 services.transmission = {
16 enable = true;
17 settings = {
18 message-level = 4;
19 download-dir = "Downloads";
20 incomplete-dir-enabled = false;
21 trash-original-torrent-files = false;
22 preallocation = 0;
23 umask = 63;
24
25 peer-port = 6882;
26 peer-port-random-on-start = false;
27 encryption = 1;
28 dht-enabled = true;
29 lpd-enabled = false;
30 pex-enabled = true;
31 port-forwarding-enabled = true;
32 scrape-paused-torrents-enabled = false;
33 peer-socket-tos = "lowcost";
34 queue-stalled-enabled = true;
35 queue-stalled-minutes = 30;
36
37 speed-limit-up = 50;
38 speed-limit-up-enabled = true;
39 alt-speed-enabled = true;
40 alt-speed-time-enabled = true;
41 alt-speed-down = 0;
42 alt-speed-up = 0;
43 alt-speed-time-day = 127; # all days. 65; # weekend only
44 alt-speed-time-begin = 360; # 06h00 local time
45 alt-speed-time-end = 1320; # 22h00 local time
46 ratio-limit = 3;
47 ratio-limit-enabled = true;
48
49 rpc-enabled = true;
50 rpc-bind-address = "127.0.0.1";
51 rpc-port = 9091;
52 rpc-whitelist = "127.0.0.1";
53 rpc-whitelist-enabled = true;
54 #rpc-authentication-required = true;
55 };
56 };
57 }