diff options
Diffstat (limited to '')
| -rw-r--r-- | modules/nixos/backups.nix (renamed from modules/backups.nix) | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/modules/backups.nix b/modules/nixos/backups.nix index 0724053..78b3144 100644 --- a/modules/backups.nix +++ b/modules/nixos/backups.nix @@ -166,14 +166,13 @@ in }; config = lib.mkIf cfg.enable { - environment.systemPackages = - [ - pkgs.restic - ] - ++ lib.optionals cfg.helpers [ - restic-local - restic-remote - ]; + environment.systemPackages = [ + pkgs.restic + ] + ++ lib.optionals cfg.helpers [ + restic-local + restic-remote + ]; services.restic.backups = lib.mkMerge [ # Local backup configuration - only if paths are specified @@ -192,20 +191,19 @@ in # Remote backup configuration - only if paths are specified (lib.mkIf (cfg.remote.paths != [ ]) { - remote = - { - initialize = true; - repository = "${cfg.remoteBaseRepository}:/${config.networking.hostName}/"; - passwordFile = cfg.passwordFile; - paths = cfg.remote.paths; - exclude = cfg.remote.exclude; - extraBackupArgs = cfg.remote.extraBackupArgs; - timerConfig = cfg.remote.timerConfig; - pruneOpts = cfg.remote.pruneOpts; - } - // lib.optionalAttrs (cfg.remote.environmentFile != null) { - environmentFile = toString cfg.remote.environmentFile; - }; + remote = { + initialize = true; + repository = "${cfg.remoteBaseRepository}:/${config.networking.hostName}/"; + passwordFile = cfg.passwordFile; + paths = cfg.remote.paths; + exclude = cfg.remote.exclude; + extraBackupArgs = cfg.remote.extraBackupArgs; + timerConfig = cfg.remote.timerConfig; + pruneOpts = cfg.remote.pruneOpts; + } + // lib.optionalAttrs (cfg.remote.environmentFile != null) { + environmentFile = toString cfg.remote.environmentFile; + }; }) ]; }; |
