mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-01-19 05:39:34 +01:00
39 lines
829 B
Nix
39 lines
829 B
Nix
{ config, lib, ... }:
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.transmission;
|
|
in
|
|
{
|
|
options = {
|
|
transmission = {
|
|
directory = mkOption {
|
|
type = lib.types.str;
|
|
default = "/srv/Multimedia";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = {
|
|
sops.secrets."transmission" = {
|
|
sopsFile = ./secrets/transmission.json;
|
|
path = "/var/lib/secrets/transmission/settings.json";
|
|
};
|
|
|
|
# torrenting apps
|
|
services.transmission = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
openRPCPort = true;
|
|
credentialsFile = config.sops.secrets."transmission".path;
|
|
settings = {
|
|
rpc-bind-address = "0.0.0.0";
|
|
rpc-whitelist-enabled = false;
|
|
rpc-authentication-required = true;
|
|
download-dir = "${cfg.directory}/Torrents";
|
|
ratio-limit-enabled = true;
|
|
};
|
|
};
|
|
};
|
|
}
|