mio-ops/profiles/transmission.nix

35 lines
1.1 KiB
Nix
Raw Normal View History

2020-06-25 01:30:32 +00:00
# NixOps configuration for the hosts running Transmission
{ config, pkgs, lib, ... }:
{
services = {
transmission = {
2021-11-16 04:57:23 +00:00
enable = true; # Enable Transmission
2021-05-31 22:35:51 +00:00
credentialsFile = "/run/keys/transmission"; # Authentication secrets
settings = {
2021-11-16 04:57:23 +00:00
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
2021-05-31 22:35:51 +00:00
};
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-11-16 04:57:23 +00:00
networking.firewall.allowedTCPPorts = [ 9091 ]; # Open the rpc firewall port
2021-05-31 22:35:51 +00:00
# Allow transmission to read the secrets keys
users.groups.keys.members = [ "transmission" ];
2020-06-25 01:30:32 +00:00
}