2020-06-25 01:30:32 +00:00
|
|
|
# NixOps configuration for the hosts running Transmission
|
|
|
|
|
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
services = {
|
|
|
|
transmission = {
|
2021-05-31 22:35:51 +00:00
|
|
|
enable = true; # Enable Transmission
|
|
|
|
credentialsFile = "/run/keys/transmission"; # Authentication secrets
|
|
|
|
settings = {
|
|
|
|
rpc-authentication-required = true; # Enforce authentication
|
|
|
|
rpc-bind-address = "0.0.0.0"; # Listen on all interfaces
|
|
|
|
rpc-whitelist = "127.0.0.1,10.42.0.*"; # Allow hosts on the LAN
|
|
|
|
};
|
2020-06-25 01:30:32 +00:00
|
|
|
};
|
|
|
|
cron = {
|
|
|
|
enable = true;
|
2021-05-31 22:35:51 +00:00
|
|
|
# Run transmission while everyone's asleep
|
2020-06-25 01:30:32 +00:00
|
|
|
systemCronJobs = [
|
|
|
|
"55 0 * * * transmission systemctl enable transmission-daemon"
|
|
|
|
"00 1 * * * transmission systemctl start transmission-daemon"
|
|
|
|
"00 7 * * * transmission systemctl stop transmission-daemon"
|
|
|
|
"05 7 * * * transmission systemctl disable transmission-daemon"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-05-31 22:35:51 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [ 9091 ]; # Open the rpc firewall port
|
|
|
|
|
|
|
|
# Allow transmission to read the secrets keys
|
|
|
|
users.groups.keys.members = [ "transmission" ];
|
2020-06-25 01:30:32 +00:00
|
|
|
|
|
|
|
}
|