unpackerr service

This commit is contained in:
death916 2025-09-16 03:17:14 -07:00
parent c499998356
commit 9040dfba3f
2 changed files with 45 additions and 2 deletions

View file

@ -6,12 +6,30 @@
...
}:
with lib;
let
cfg = config.arrSuite;
in
{
options.arrSuite = {
enable = lib.mkEnableOption "Enable Sonarr, Radarr, Readarr, and Prowlarr suite";
enable = mkEnableOption "Enable Sonarr, Radarr, Readarr, and Prowlarr suite";
unpackerr = {
enable = mkEnableOption "Enable Unpackerr service";
downloadPath = mkOption {
type = types.str;
default = "/media/storage/media/downloads";
description = "Path to the download directory to watch.";
};
extractPath = mkOption {
type = types.str;
default = "";
description = "Path to extract files to. Leave empty to extract in place.";
};
};
};
config = lib.mkIf config.arrSuite.enable {
config = mkIf cfg.enable {
# Define a common group for media services
users.groups.media_services = { };
@ -73,5 +91,29 @@
isSystemUser = true;
group = "media_services";
};
systemd.services.unpackerr = mkIf cfg.unpackerr.enable {
description = "Unpackerr Service";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "unpackerr";
Group = "media_services";
ExecStart = ''
${pkgs.unpackerr}/bin/unpackerr --config ${
pkgs.writeText "unpackerr.conf" ''
[unpackerr]
log_file = "/var/log/unpackerr.log"
log_files = 10
log_file_mb = 10
[[folder]]
path = "${cfg.unpackerr.downloadPath}"
extract_path = "${cfg.unpackerr.extractPath}"
''
}
'';
};
};
};
}

View file

@ -18,6 +18,7 @@
];
config = {
arrSuite.unpackerr.enable = true;
services.kopia-server.enable = true;
system.stateVersion = "24.11";