nixpkgs/nixos/modules/services/misc/jellyseerr.nix

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

74 lines
1.9 KiB
Nix
Raw Permalink Normal View History

2023-02-13 02:27:34 +01:00
{
config,
pkgs,
lib,
...
}:
let
cfg = config.services.jellyseerr;
in
{
meta.maintainers = [ lib.maintainers.camillemndn ];
2023-02-13 02:27:34 +01:00
options.services.jellyseerr = {
enable = lib.mkEnableOption ''Jellyseerr, a requests manager for Jellyfin'';
package = lib.mkPackageOption pkgs "jellyseerr" { };
2023-02-13 02:27:34 +01:00
openFirewall = lib.mkOption {
type = lib.types.bool;
2023-02-13 02:27:34 +01:00
default = false;
description = ''Open port in the firewall for the Jellyseerr web interface.'';
};
port = lib.mkOption {
type = lib.types.port;
2023-02-13 02:27:34 +01:00
default = 5055;
description = ''The port which the Jellyseerr web UI should listen to.'';
};
2024-12-25 18:49:03 -06:00
configDir = lib.mkOption {
type = lib.types.path;
default = "/var/lib/jellyseerr/config";
description = "Config data directory";
};
2023-02-13 02:27:34 +01:00
};
config = lib.mkIf cfg.enable {
2023-02-13 02:27:34 +01:00
systemd.services.jellyseerr = {
description = "Jellyseerr, a requests manager for Jellyfin";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
2024-12-25 18:49:03 -06:00
environment = {
PORT = toString cfg.port;
CONFIG_DIRECTORY = cfg.configDir;
};
2023-02-13 02:27:34 +01:00
serviceConfig = {
Type = "exec";
StateDirectory = "jellyseerr";
DynamicUser = true;
ExecStart = lib.getExe cfg.package;
2023-02-13 02:27:34 +01:00
Restart = "on-failure";
ProtectHome = true;
ProtectSystem = "strict";
PrivateTmp = true;
PrivateDevices = true;
ProtectHostname = true;
ProtectClock = true;
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectKernelLogs = true;
ProtectControlGroups = true;
NoNewPrivileges = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
RemoveIPC = true;
PrivateMounts = true;
};
};
networking.firewall = lib.mkIf cfg.openFirewall {
2023-02-13 02:27:34 +01:00
allowedTCPPorts = [ cfg.port ];
};
};
}