aboutsummaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-11-17 18:45:43 -0800
committerFranck Cuny <franck@fcuny.net>2025-11-17 18:45:43 -0800
commitea945371f41101aca0a863f52e7156dc4019657d (patch)
tree50994f198d6923e77894df0fdf2e35dc851747c9 /profiles
parentstore the backup locally (diff)
downloadinfra-ea945371f41101aca0a863f52e7156dc4019657d.tar.gz
configure backups correctly
Set a reasonable retention policy, and drop the helper scripts, the module for restic already does it.
Diffstat (limited to 'profiles')
-rw-r--r--profiles/restic-backup.nix19
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"
+ ];
};
};
};