diff --git a/modules/hosts/common/linux/restic.nix b/modules/hosts/common/linux/restic.nix index 6f3b1ee..9a5ff72 100644 --- a/modules/hosts/common/linux/restic.nix +++ b/modules/hosts/common/linux/restic.nix @@ -17,6 +17,10 @@ repositoryFile = config.sops.secrets.restic_repo.path; passwordFile = config.sops.secrets.restic_password.path; + extraBackupArgs = [ + "--retry-lock 2h" + ] + pruneOpts = [ "--keep-daily 7" "--keep-weekly 5" diff --git a/modules/hosts/nixos/hetznix01/post-install/default.nix b/modules/hosts/nixos/hetznix01/post-install/default.nix index 54cabb2..eff2077 100644 --- a/modules/hosts/nixos/hetznix01/post-install/default.nix +++ b/modules/hosts/nixos/hetznix01/post-install/default.nix @@ -1,5 +1,6 @@ { config, lib, pkgs, username, ... }: let domain = "technicalissues.us"; + restic_backup_time = "01:00"; in { imports = [ ../../../common/linux/lets-encrypt.nix @@ -126,11 +127,17 @@ in { secretKeybaseFile = config.sops.secrets.plausible_secret_key_base.path; }; }; - restic.backups.daily.paths = [ - "${config.users.users.${username}.home}/compose-files/owntracks" - "/var/backup/postgresql" - "/var/lib/uptime-kuma" - ]; + restic.backups.daily = { + paths = [ + "${config.users.users.${username}.home}/compose-files/owntracks" + "/var/backup/postgresql" + "/var/lib/uptime-kuma" + ]; + timerConfig = { + OnCalendar = restic_backup_time; + Persistent = true; + }; + }; tailscale = { enable = true; authKeyFile = config.sops.secrets.tailscale_key.path; diff --git a/modules/hosts/nixos/nixnuc/default.nix b/modules/hosts/nixos/nixnuc/default.nix index 2f73fbc..314dde8 100644 --- a/modules/hosts/nixos/nixnuc/default.nix +++ b/modules/hosts/nixos/nixnuc/default.nix @@ -4,6 +4,7 @@ home_domain = "home.technicalissues.us"; backend_ip = "127.0.0.1"; mini_watcher = "192.168.23.20"; + restic_backup_time = "02:00"; in { imports = [ ./hardware-configuration.nix @@ -516,18 +517,24 @@ in { ]; }; resolved.enable = true; - restic.backups.daily.paths = [ - config.services.forgejo.stateDir - config.services.grafana.dataDir - config.services.mealie.settings.DATA_DIR - config.services.nextcloud.home - "${config.users.users.${username}.home}/compose-files/wallabag" - "/orico/immich/library" - "/orico/jellyfin/data" - "/orico/jellyfin/staging/downloaded-files" - "/var/backup/postgresql" - "/var/lib/prometheus2" - ]; + restic.backups.daily = { + paths = [ + config.services.forgejo.stateDir + config.services.grafana.dataDir + config.services.mealie.settings.DATA_DIR + config.services.nextcloud.home + "${config.users.users.${username}.home}/compose-files/wallabag" + "/orico/immich/library" + "/orico/jellyfin/data" + "/orico/jellyfin/staging/downloaded-files" + "/var/backup/postgresql" + "/var/lib/prometheus2" + ]; + timerConfig = { + OnCalendar = restic_backup_time; + Persistent = true; + }; + }; smartd.enable = true; syncthing = { enable = true;