1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 19:47:47 +00:00

Set up restic on all hosts

This commit is contained in:
RGBCube 2024-05-27 13:38:44 +03:00
parent f5da41b495
commit fefb810d97
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M
15 changed files with 100 additions and 82 deletions

View file

@ -0,0 +1,27 @@
{ config, lib, ... }: with lib;
serverSystemConfiguration {
options.resticHosts = mkConst (remove config.networking.hostName [ "cube" "disk" "nine" ]);
config = {
secrets.resticPassword.file = ./password.age;
services.restic.backups = genAttrs config.resticHosts (host: {
repository = "sftp:backup@${host}:${config.networking.hostName}-backup";
passwordFile = config.secrets.resticPassword.path;
initialize = true;
pruneOpts = [
"--keep-daily unlimited"
"--keep-weekly unlimited"
"--keep-monthly 6"
"--keep-yearly 12"
];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
});
};
}