add restic backup on vps
This commit is contained in:
parent
683b7fb52f
commit
d6586af313
@ -7,6 +7,7 @@
|
|||||||
./hardware
|
./hardware
|
||||||
./network.nix
|
./network.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
|
./services/backups.nix
|
||||||
./services/dns.nix
|
./services/dns.nix
|
||||||
./services/tor-bridge.nix
|
./services/tor-bridge.nix
|
||||||
./services/wireguard.nix
|
./services/wireguard.nix
|
||||||
|
20
machines/NixOS-VPS/services/backups.nix
Normal file
20
machines/NixOS-VPS/services/backups.nix
Normal 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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user