diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-10-13 08:52:36 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-10-13 08:52:36 -0700 |
| commit | bca7e01468e0bb43fdefaf3d13f5ecea44501417 (patch) | |
| tree | 9d3134fa94cb9cef086b2d7f2dc65ef08617b986 /modules/nixos/backups.nix | |
| parent | delete unused module (diff) | |
| download | infra-bca7e01468e0bb43fdefaf3d13f5ecea44501417.tar.gz | |
move modules under nixos
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; + }; }) ]; }; |
