diff --git a/modules/media/arr-suite.nix b/modules/media/arr-suite.nix index 0f1aa04..ebdda66 100644 --- a/modules/media/arr-suite.nix +++ b/modules/media/arr-suite.nix @@ -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}"; }; }; };