504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
43 lines
952 B
Nix
43 lines
952 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.prowlarr;
|
|
|
|
in
|
|
{
|
|
options = {
|
|
services.prowlarr = {
|
|
enable = mkEnableOption (lib.mdDoc "Prowlarr");
|
|
|
|
package = mkPackageOption pkgs "prowlarr" { };
|
|
|
|
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";
|
|
ExecStart = "${lib.getExe cfg.package} -nobrowser -data=/var/lib/prowlarr";
|
|
Restart = "on-failure";
|
|
};
|
|
};
|
|
|
|
networking.firewall = mkIf cfg.openFirewall {
|
|
allowedTCPPorts = [ 9696 ];
|
|
};
|
|
};
|
|
}
|