1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-22 01:11:02 +03:00
nixpkgs/nixos/modules/services/misc/prowlarr.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1 KiB
Nix
Raw Normal View History

2021-10-10 08:53:03 -07:00
{ config, pkgs, lib, ... }:
let
cfg = config.services.prowlarr;
in
{
options = {
services.prowlarr = {
enable = lib.mkEnableOption "Prowlarr, an indexer manager/proxy for Torrent trackers and Usenet indexers";
2021-10-10 08:53:03 -07:00
package = lib.mkPackageOption pkgs "prowlarr" { };
2023-07-12 10:19:05 +01:00
openFirewall = lib.mkOption {
type = lib.types.bool;
2021-10-10 08:53:03 -07:00
default = false;
description = "Open ports in the firewall for the Prowlarr web interface.";
};
};
};
config = lib.mkIf cfg.enable {
2021-10-10 08:53:03 -07:00
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";
2021-10-10 08:53:03 -07:00
Restart = "on-failure";
};
environment.HOME = "/var/empty";
2021-10-10 08:53:03 -07:00
};
networking.firewall = lib.mkIf cfg.openFirewall {
2021-10-10 08:53:03 -07:00
allowedTCPPorts = [ 9696 ];
};
};
}