rice/hosts/ami/borg.nix

32 lines
769 B
Nix
Raw Normal View History

2024-01-25 15:54:05 +00:00
{
config,
pkgs,
...
}: let
2024-03-29 20:56:26 +00:00
host = "zh4250@zh4250.rsync.net";
2024-01-25 15:54:05 +00:00
in {
age.secrets.borgpassword.file = ../../secrets/borgpassword.age;
services.borgbackup = {
jobs.backup = {
paths = ["/etc" "/home" "/root" "/var"];
exclude = ["/var/log" "/home/buffet/Downloads" "/home/buffet/tmp"];
2024-01-25 15:54:05 +00:00
repo = "${host}:${config.networking.hostName}";
encryption = {
mode = "repokey";
passCommand = "cat ${config.age.secrets.borgpassword.path}";
};
startAt = "daily";
persistentTimer = true;
environment.BORG_RSH = "ssh -i /root/.ssh/id_borg";
2024-01-25 15:54:05 +00:00
extraArgs = "--remote-path borg1";
prune.keep = {
within = "1d";
daily = 7;
weekly = 4;
monthly = -1;
};
};
};
}