diff --git a/modules/restic.nix b/modules/restic.nix index a9856c2..f6f2a16 100644 --- a/modules/restic.nix +++ b/modules/restic.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, options, ... }: +{ pkgs, config, lib, ... }: let cfg = config.sbruder.restic; @@ -41,20 +41,13 @@ in { options.sbruder.restic = { enable = lib.mkEnableOption "restic"; - timerConfig = lib.recursiveUpdate - ((lib.elemAt - (lib.elemAt - options.services.restic.backups.type.getSubModules - 0 - ).imports - 0) - { name = ""; }).options.timerConfig - { - default = { - OnCalendar = "20:00"; - RandomizedDelaySec = "2h"; - }; + timerConfig = lib.mkOption { + type = with lib.types; attrsOf str; + default = { + OnCalendar = "20:00"; + RandomizedDelaySec = "2h"; }; + }; extraPaths = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ ]; @@ -74,6 +67,7 @@ in services.restic.backups.system = { inherit repository; + inherit (cfg) timerConfig; passwordFile = config.krops.secrets.restic-password.path; s3CredentialsFile = config.krops.secrets.restic-s3.path; paths = [ @@ -87,7 +81,6 @@ in "--exclude-file=${excludesFile}" "--verbose" ]; - timerConfig = cfg.timerConfig; }; systemd.services."restic-backups-system".serviceConfig = {