]> Git — Sourcephile - sourcephile-nix.git/blob - servers/losurdo/transmission.nix
nftables: open firewall from mermet to losurdo
[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 ${toString users.transmission.uid} counter accept comment "Transmission"
14 '';
15 services.transmission = {
16 enable = true;
17 #home = "/var/lib/torrs4";
18 settings = {
19 message-level = 4;
20 download-dir = "Downloads";
21 incomplete-dir-enabled = false;
22 trash-original-torrent-files = false;
23 preallocation = 0;
24 umask = 63;
25
26 peer-port = 6882;
27 peer-port-random-on-start = false;
28 encryption = 1;
29 dht-enabled = true;
30 lpd-enabled = false;
31 pex-enabled = true;
32 port-forwarding-enabled = true;
33 scrape-paused-torrents-enabled = false;
34 peer-socket-tos = "lowcost";
35 queue-stalled-enabled = true;
36 queue-stalled-minutes = 30;
37
38 speed-limit-up = 500;
39 speed-limit-up-enabled = true;
40 alt-speed-enabled = true;
41 alt-speed-time-enabled = true;
42 alt-speed-down = 0;
43 alt-speed-up = 50;
44 alt-speed-time-day = 127; # all days. 65; # weekend only
45 alt-speed-time-begin = 360; # 06h00 local time
46 alt-speed-time-end = 1380; # 23h00 local time
47 ratio-limit = 3;
48 ratio-limit-enabled = true;
49
50 rpc-enabled = true;
51 rpc-bind-address = "127.0.0.1";
52 rpc-port = 9091;
53 rpc-whitelist = "127.0.0.1";
54 rpc-whitelist-enabled = true;
55 #rpc-authentication-required = true;
56 };
57 };
58 }