diff --git a/modules/arr.nix b/modules/arr.nix index f37fd55..dd49782 100644 --- a/modules/arr.nix +++ b/modules/arr.nix @@ -155,6 +155,16 @@ let description = "OIDC endpoint for SSO"; example = "https://authelia.example.com"; }; + + backupCfg = lib.mkOption { + type = lib.types.anything; + description = "Backup configuration for ${name}."; + default = {}; + example = { + backend = "restic"; + repositories = []; + }; + }; } // (c.moreOptions or {}); }; }); @@ -309,7 +319,7 @@ config.xml" templatedSettings) "${config.services.radarr.dataDir}/config.xml" ( shb.backup.instances = let - backupConfig = name: _defaults: { + backupConfig = name: _defaults: lib.mkIf (cfg.${name}.backupCfg != {}) { ${name} = { sourceDirectories = [ config.shb.arr.${name}.dataDir diff --git a/test/modules/arr.nix b/test/modules/arr.nix index 6392780..939b82d 100644 --- a/test/modules/arr.nix +++ b/test/modules/arr.nix @@ -36,6 +36,7 @@ in { testArrNoOptions = { expected = { + systemd.services.radarr = {}; systemd.services.jackett = {}; shb.backup = {}; shb.nginx.autheliaProtect = [];