diff --git a/hosts/backwards/modules/restic/default.nix b/hosts/backwards/modules/restic/default.nix index 961ea02..0e84e51 100644 --- a/hosts/backwards/modules/restic/default.nix +++ b/hosts/backwards/modules/restic/default.nix @@ -37,12 +37,35 @@ in "--keep-yearly 12" ]; }; + + "sync-to-cloud" = { + initialize = true; + + passwordFile = config.age.secrets.restic-password.path; + environmentFile = config.age.secrets.restic-cloud-sync-key.path; + repositoryFile = config.age.secrets.restic-cloud-sync-repository.path; + + paths = ["/home/alex/sync"]; + + timerConfig = { + OnCalendar = "*-*-* 0/12:00:00"; # Every 12th hour, i.e. twice a day + Persistent = true; + }; + + pruneOpts = [ + "--keep-daily 1" + "--keep-weekly 7" + "--keep-yearly 12" + ]; + }; }; }; age = { secrets = { "restic-password".file = ../../../../secrets/backwards/restic-password.age; + "restic-cloud-sync-key".file = ../../../../secrets/backwards/restic-cloud-sync-key.age; + "restic-cloud-sync-repository".file = ../../../../secrets/backwards/restic-cloud-sync-repository.age; }; }; };