From 7e5a44725756bd9524ff2851dbddf3b8b0ba88b9 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Thu, 16 Nov 2023 23:00:53 -0800 Subject: [PATCH] fix tests --- modules/arr.nix | 12 +++++++++++- test/modules/arr.nix | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) 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 = [];