bonfire/modules/services/transmission.nix

33 lines
860 B
Nix
Raw Normal View History

2023-06-06 23:18:09 +05:00
{ config, options, pkgs, lib, ... }:
with lib;
with lib.custom;
let
cfg = config.modules.services.transmission;
in {
options.modules.services.transmission = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
services.transmission = {
enable = true;
home = "${config.user.home}/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" ];
};
}