nix-stuff/roles/server/transmission.nix

32 lines
926 B
Nix
Executable file

{config, ...}: {
services.transmission = {
enable = true;
openFirewall = true;
settings = {
incomplete-dir-enabled = false;
rpc-bind-address = "0.0.0.0";
rpc-host-whitelist = "transmission.everest.sable-pancake.ts.net";
rpc-whitelist = "127.0.0.1";
};
};
# Add a cname for transmission
services.dnsmasq.settings.cname = ["transmission.everest.sable-pancake.ts.net,everest"];
# Set up traefik as the reverse proxy for transmission
services.traefik = {
dynamicConfigOptions = {
http = {
routers = {
transmission-subdomain = {
rule = "Host(`transmission.everest.sable-pancake.ts.net`)";
service = "transmission";
};
};
services.transmission.loadBalancer.servers = [
{url = "http://localhost:${toString config.services.transmission.settings.rpc-port}";}
];
};
};
};
}