mirror of
https://github.com/Death916/nixconfig.git
synced 2026-04-10 02:54:39 -07:00
unpackerr service
This commit is contained in:
parent
c499998356
commit
9040dfba3f
2 changed files with 45 additions and 2 deletions
|
|
@ -6,12 +6,30 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.arrSuite;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.arrSuite = {
|
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
|
# Define a common group for media services
|
||||||
users.groups.media_services = { };
|
users.groups.media_services = { };
|
||||||
|
|
||||||
|
|
@ -73,5 +91,29 @@
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = "media_services";
|
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}"
|
||||||
|
''
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
arrSuite.unpackerr.enable = true;
|
||||||
services.kopia-server.enable = true;
|
services.kopia-server.enable = true;
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue