add restic backup on vps

This commit is contained in:
Dmitriy Kholkin 2023-06-27 23:08:41 +03:00
parent 683b7fb52f
commit d6586af313
2 changed files with 21 additions and 0 deletions

View File

@ -7,6 +7,7 @@
./hardware
./network.nix
./nix.nix
./services/backups.nix
./services/dns.nix
./services/tor-bridge.nix
./services/wireguard.nix

View File

@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }: {
services.restic.backups.vps-data = {
initialize = true;
passwordFile = "/srv/restic-pass";
repositoryFile = "/srv/restic-repo";
paths = [ "/srv" ];
exclude = [ "/srv/restic-pass" "/srv/restic-repo" ];
environmentFile = "${pkgs.writeText "restic.env" "GOMAXPROCS=1"}";
extraBackupArgs = [ "--no-scan" ];
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 5"
"--keep-yearly 2"
];
};
}