2020-10-01 15:46:04 -07:00
|
|
|
{ config, options, pkgs, lib, my, ... }:
|
2020-01-13 21:25:39 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
with lib;
|
|
|
|
with lib.my;
|
|
|
|
let cfg = config.modules.services.transmission;
|
|
|
|
in {
|
|
|
|
options.modules.services.transmission = {
|
|
|
|
enable = mkBoolOpt false;
|
2020-01-13 21:25:39 -08:00
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.transmission = {
|
|
|
|
enable = true;
|
2021-01-19 22:28:30 -08:00
|
|
|
home = "${config.user.home}/torrents";
|
2020-10-01 15:46:04 -07:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
2020-01-13 21:25:39 -08:00
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
networking.firewall = {
|
|
|
|
allowedTCPPorts = [ 51413 ];
|
|
|
|
allowedUDPPorts = [ 51413 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
user.extraGroups = [ "transmission" ];
|
|
|
|
};
|
2020-01-13 21:25:39 -08:00
|
|
|
}
|