-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransmission.nix
41 lines (39 loc) · 1.57 KB
/
transmission.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ config, lib, ... }:
let
inherit (lib) mkIf;
in
{
config = mkIf config.services.transmission.enable {
networking.ports = {
transmission-000 = { enable = true; port = 49120;}; # highest port
transmission-001 = { enable = true; port = 49119;};
transmission-002 = { enable = true; port = 49118;};
transmission-003 = { enable = true; port = 49117;};
transmission-004 = { enable = true; port = 49116;};
transmission-005 = { enable = true; port = 49115;};
transmission-006 = { enable = true; port = 49114;};
transmission-007 = { enable = true; port = 49113;};
transmission-008 = { enable = true; port = 49112;};
transmission-009 = { enable = true; port = 49111;};
transmission-999 = { enable = true; port = 49110;}; # lowest port
transmission-rpc = { enable = true; port = 49109;};
};
services.transmission = {
openFirewall = true;
openPeerPorts = true;
settings = {
peer-port-random-on-start = true;
peer-port-random-low = config.networking.ports.transmission-999.port;
peer-port-random-high = config.networking.ports.transmission-000.port;
rpc-port = config.networking.ports.transmission-rpc.port;
message-level = 3; # journalctl all the things, hope it doesnt spam
utp-enabled = true;
};
};
services.nginx.virtualHosts."transmission.${config.networking.hostName}.${config.networking.domain}" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.transmission.settings.rpc-port}";
};
};
};
}