31 lines
817 B
Nix
31 lines
817 B
Nix
{
|
|
pkgs,
|
|
service_configs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
(lib.serviceMountWithZpool "prowlarr" service_configs.zpool_ssds [
|
|
service_configs.prowlarr.dataDir
|
|
])
|
|
(lib.vpnNamespaceOpenPort service_configs.ports.prowlarr "prowlarr")
|
|
];
|
|
|
|
services.prowlarr = {
|
|
enable = true;
|
|
dataDir = service_configs.prowlarr.dataDir;
|
|
settings.server.port = service_configs.ports.prowlarr;
|
|
};
|
|
|
|
systemd.services.prowlarr.serviceConfig = {
|
|
ExecStartPre = "+${pkgs.coreutils}/bin/chown -R prowlarr /var/lib/prowlarr";
|
|
};
|
|
|
|
services.caddy.virtualHosts."prowlarr.${service_configs.https.domain}".extraConfig = ''
|
|
import ${config.age.secrets.caddy_auth.path}
|
|
reverse_proxy ${config.vpnNamespaces.wg.namespaceAddress}:${builtins.toString service_configs.ports.prowlarr}
|
|
'';
|
|
}
|