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
9040dfba3f
commit
5f4e1ffd2b
1 changed files with 7 additions and 23 deletions
|
|
@ -10,21 +10,17 @@ with lib;
|
|||
|
||||
let
|
||||
cfg = config.arrSuite;
|
||||
unpackerrCfg = cfg.unpackerr;
|
||||
in
|
||||
{
|
||||
options.arrSuite = {
|
||||
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.";
|
||||
configFile = mkOption {
|
||||
type = types.path;
|
||||
default = "/etc/unpackerr/unpackerr.conf";
|
||||
description = "Path to the unpackerr.conf file.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -92,7 +88,7 @@ in
|
|||
group = "media_services";
|
||||
};
|
||||
|
||||
systemd.services.unpackerr = mkIf cfg.unpackerr.enable {
|
||||
systemd.services.unpackerr = mkIf unpackerrCfg.enable {
|
||||
description = "Unpackerr Service";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
|
@ -100,19 +96,7 @@ in
|
|||
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}"
|
||||
''
|
||||
}
|
||||
'';
|
||||
ExecStart = "${pkgs.unpackerr}/bin/unpackerr --config ${unpackerrCfg.configFile}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue