mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 17:03:01 +00:00
45 lines
1.0 KiB
Nix
45 lines
1.0 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.prowlarr;
|
|
|
|
in
|
|
{
|
|
options = {
|
|
services.prowlarr = {
|
|
enable = mkEnableOption "Prowlarr, an indexer manager/proxy for Torrent trackers and Usenet indexers";
|
|
|
|
package = mkPackageOption pkgs "prowlarr" { };
|
|
|
|
openFirewall = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = "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";
|
|
};
|
|
environment.HOME = "/var/empty";
|
|
};
|
|
|
|
networking.firewall = mkIf cfg.openFirewall {
|
|
allowedTCPPorts = [ 9696 ];
|
|
};
|
|
};
|
|
}
|