2022-08-22 18:32:26 +00:00
|
|
|
{config, ...}: let
|
|
|
|
host = "11967@prio.ch-s011.rsync.net";
|
|
|
|
in {
|
|
|
|
age.secrets.borgpassword.file = ../secrets/borgpassword.age;
|
|
|
|
|
|
|
|
services.borgbackup = {
|
|
|
|
jobs.backup = {
|
|
|
|
paths = ["/persist"];
|
|
|
|
repo = "${host}:${config.networking.hostName}";
|
|
|
|
encryption = {
|
|
|
|
mode = "repokey";
|
|
|
|
passCommand = "cat ${config.age.secrets.borgpassword.path}";
|
|
|
|
};
|
|
|
|
startAt = "daily";
|
2022-09-04 14:07:36 +00:00
|
|
|
persistentTimer = true;
|
2022-08-22 18:32:26 +00:00
|
|
|
environment.BORG_RSH = "ssh -i /home/buffet/.ssh/id_borg";
|
|
|
|
extraArgs = "--remote-path borg1";
|
|
|
|
prune.keep = {
|
|
|
|
within = "1d";
|
|
|
|
daily = 7;
|
|
|
|
weekly = 4;
|
|
|
|
monthly = -1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-09-05 16:27:07 +00:00
|
|
|
|
|
|
|
systemd.services = {
|
|
|
|
borgbackup-backup-job = {
|
|
|
|
after = ["ensure-online.service"];
|
|
|
|
requires = ["ensure-online.service"];
|
|
|
|
};
|
|
|
|
|
|
|
|
ensure-online = {
|
|
|
|
description = "waiting for Network";
|
|
|
|
after = ["network-online.target"];
|
|
|
|
requires = ["network-online.target"];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.networkmanager}/bin/nm-online -q --timeout=300";
|
|
|
|
Type = "oneshot";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-08-22 18:32:26 +00:00
|
|
|
}
|