diff options
Diffstat (limited to 'profiles/restic-backup.nix')
| -rw-r--r-- | profiles/restic-backup.nix | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/profiles/restic-backup.nix b/profiles/restic-backup.nix index 876641e..a608415 100644 --- a/profiles/restic-backup.nix +++ b/profiles/restic-backup.nix @@ -1,11 +1,4 @@ { config, pkgs, ... }: -let - restic-local = pkgs.writeShellScriptBin "restic-local" '' - export RESTIC_REPOSITORY="/data/backups/" - export RESTIC_PASSWORD_FILE="${config.age.secrets.restic-local-pw.path}" - exec ${pkgs.restic}/bin/restic "$@" - ''; -in { age = { secrets = { @@ -15,9 +8,8 @@ in }; }; - environment.systemPackages = [ - pkgs.restic - restic-local + environment.systemPackages = with pkgs; [ + restic ]; services.restic = { @@ -27,9 +19,14 @@ in passwordFile = config.age.secrets.restic-local-pw.path; repository = "/data/backups/"; initialize = true; - timerConfig.OnCalendar = "*-*-* *:00:00"; + timerConfig.OnCalendar = "daily"; timerConfig.RandomizedDelaySec = "5m"; extraBackupArgs = [ ]; + pruneOpts = [ + "--keep-daily=7" + "--keep-weekly=4" + "--keep-monthly=12" + ]; }; }; }; |
