2021-10-10 17:53:03 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.prowlarr;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.prowlarr = {
|
|
|
|
enable = mkEnableOption (lib.mdDoc "Prowlarr");
|
|
|
|
|
2023-11-30 19:03:14 +01:00
|
|
|
package = mkPackageOption pkgs "prowlarr" { };
|
2023-07-12 11:19:05 +02:00
|
|
|
|
2021-10-10 17:53:03 +02:00
|
|
|
openFirewall = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = lib.mdDoc "Open ports in the firewall for the Prowlarr web interface.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.prowlarr = {
|
|
|
|
description = "Prowlarr";
|
|
|
|
after = [ "network.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
DynamicUser = true;
|
|
|
|
StateDirectory = "prowlarr";
|
2023-07-14 15:43:26 +02:00
|
|
|
ExecStart = "${lib.getExe cfg.package} -nobrowser -data=/var/lib/prowlarr";
|
2021-10-10 17:53:03 +02:00
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall = mkIf cfg.openFirewall {
|
|
|
|
allowedTCPPorts = [ 9696 ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|