37 lines
965 B
Nix
37 lines
965 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
service_configs,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
(lib.serviceMountWithZpool "radarr" service_configs.zpool_ssds [
|
|
service_configs.radarr.dataDir
|
|
])
|
|
(lib.serviceMountWithZpool "radarr" service_configs.zpool_hdds [
|
|
service_configs.torrents_path
|
|
])
|
|
(lib.serviceFilePerms "radarr" [
|
|
"Z ${service_configs.radarr.dataDir} 0700 ${config.services.radarr.user} ${config.services.radarr.group}"
|
|
])
|
|
];
|
|
|
|
services.radarr = {
|
|
enable = true;
|
|
dataDir = service_configs.radarr.dataDir;
|
|
settings.server.port = service_configs.ports.radarr;
|
|
settings.update.mechanism = "external";
|
|
};
|
|
|
|
services.caddy.virtualHosts."radarr.${service_configs.https.domain}".extraConfig = ''
|
|
import ${config.age.secrets.caddy_auth.path}
|
|
reverse_proxy :${builtins.toString service_configs.ports.radarr}
|
|
'';
|
|
|
|
users.users.${config.services.radarr.user}.extraGroups = [
|
|
service_configs.media_group
|
|
];
|
|
}
|