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:
parent
f5da41b495
commit
fefb810d97
15 changed files with 100 additions and 82 deletions
27
modules/restic/default.nix
Normal file
27
modules/restic/default.nix
Normal 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;
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue