nixos-config/modules/borgbackup.nix
2024-04-03 15:20:15 +02:00

41 lines
1.1 KiB
Nix

{config,...}:
{
programs.ssh.knownHosts = {
"borg.cased.de" = { publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOwKHZZiJ/GgDmAbO2VdGNJIcBQKnFQNXBBzyrsK+ZE0"; };
};
services.borgbackup.jobs = {
home = {
paths = "/home";
exclude = [
"/home/fleaz/.cache"
"/home/fleaz/Downloads"
"/home/fleaz/VirtualBox VMs"
"/home/fleaz/repos"
"/home/fleaz/.config/Code"
"/home/fleaz/.config/Element"
"/home/fleaz/.config/Signal"
"/home/fleaz/.config/chromium"
"/home/fleaz/.config/discord"
"/home/fleaz/.thunderbird"
"/home/fleaz/.mozilla"
"/home/fleaz/.vscode"
"/home/fleaz/.local"
];
extraCreateArgs = "--stats";
repo = "fleaz@borg.cased.de:${config.networking.hostName}";
environment = { BORG_RSH = "ssh -i /home/fleaz/.ssh/id_borgbackup"; };
encryption = {
mode = "repokey-blake2";
passCommand = "cat /etc/secrets/borgbackup.txt";
};
compression = "auto,zstd";
startAt = "hourly";
prune.keep = {
daily = 30;
monthly = 6;
};
};
};
}