helm/modules/services/transmission.nix
Henrik Lissner a75c64d04a
Rewrite to use flakes
This puts a hard dependency on 20.09, but that's to be expected.
2020-10-11 01:31:33 -04:00

33 lines
732 B
Nix

{ config, options, pkgs, lib, my, ... }:
with lib;
with lib.my;
let cfg = config.modules.services.transmission;
in {
options.modules.services.transmission = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
services.transmission = {
enable = true;
home = "${homeDir}/torrents";
settings = {
incomplete-dir-enabled = true;
rpc-whitelist = "127.0.0.1,192.168.*.*";
rpc-host-whitelist = "*";
rpc-host-whitelist-enabled = true;
ratio-limit = 0;
ratio-limit-enabled = true;
};
};
networking.firewall = {
allowedTCPPorts = [ 51413 ];
allowedUDPPorts = [ 51413 ];
};
user.extraGroups = [ "transmission" ];
};
}