added prowlarr

This commit is contained in:
ari committed 2024-09-28 12:59:15 -04:00
1 parent a4aa3da89e
commit 63d8298e17
2 files changed
+44

No files matched your search

+1
View File
@@ -7,5 +7,6 @@
./ai-services.nix
./jellyfin.nix
./admin.nix
./prowlarr.nix
];
}
+43
View File
@@ -0,0 +1,43 @@
{ config, lib, ... }:
let
cfg = config.services.prowlarr;
in
{
options = {
services.prowlarr = {
dataDir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/prowlarr";
description = "data directory for prowlarr";
};
port = lib.mkOption {
type = lib.types.int;
default = 9096;
description = "Port for prowlarr";
};
};
};
config = lib.mkIf cfg.enable {
systemd.services.prowlarr = {
description = "Prowlarr";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
DynamicUser = true;
StateDirectory = "prowlarr";
ExecStart = "${lib.getExe cfg.package} -nobrowser -data=${cfg.dataDir}";
Restart = "on-failure";
};
environment.HOME = "/var/empty";
};
networking.firewall = lib.mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
};
};
}