20 current 2025-10-07 00:49:35 25.05.20251001.5b5be50 6.12.49 *

This commit is contained in:
2025-10-07 14:05:46 -05:00
parent 1bd810cfd1
commit 0e116c587b
5 changed files with 17 additions and 67 deletions

View File

@@ -4,6 +4,7 @@ let
cfg = config.modules.services.sonarr;
ids = lib.mkForce 2005;
default_port = 8989;
data_dir = "/var/lib/sonarr";
in
{
options.modules.services.sonarr = {
@@ -15,6 +16,11 @@ in
description = "set port for sonarr (${toString default_port})";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
};
};
config = lib.mkIf cfg.enable {
@@ -24,7 +30,7 @@ in
# declare sonarr user
users.users.sonarr = {
description = "sonarr media server user";
description = "sonarr server user";
uid = ids;
isSystemUser = true;
home = "/var/lib/sonarr";
@@ -39,7 +45,7 @@ in
openFirewall = true;
user = "sonarr";
group = "sonarr";
dataDir = "/var/lib/sonarr";
dataDir = data_dir;
settings = {
server.port = cfg.port; # default: 8989
};
@@ -61,5 +67,8 @@ in
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ data_dir ];
};
}