2021-10-11 16:52:03 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.prowlarr;
|
|
|
|
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
services.prowlarr = {
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = mkEnableOption "Prowlarr, an indexer manager/proxy for Torrent trackers and Usenet indexers";
|
2021-10-11 16:52:03 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
package = mkPackageOption pkgs "prowlarr" { };
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
openFirewall = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = "Open ports in the firewall for the Prowlarr web interface.";
|
2021-10-11 16:52:03 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
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-15 17:15:38 +00:00
|
|
|
ExecStart = "${lib.getExe cfg.package} -nobrowser -data=/var/lib/prowlarr";
|
2021-10-11 16:52:03 +00:00
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
2024-09-19 14:19:46 +00:00
|
|
|
environment.HOME = "/var/empty";
|
2021-10-11 16:52:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall = mkIf cfg.openFirewall {
|
|
|
|
allowedTCPPorts = [ 9696 ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|