config: add borg backups

This commit is contained in:
Fabian Montero 2025-08-26 02:34:20 -06:00
parent 02529ca146
commit db1e3dcdc6
Signed by: fabian
GPG key ID: 1FFAC35E1798174F
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{
config,
pkgs,
lib,
flakes,
...
}: {
services.borgbackup.jobs = {
rsync = {
paths = [
"/home/fabian/nix"
];
exclude = [
];
user = "root";
group = "root";
doInit = true;
startAt = [
"hourly"
];
inhibitsSleep = true;
persistentTimer = true;
repo = "zh5777@zh5777.rsync.net:posixlycorrect";
encryption = {
mode = "repokey-blake2";
passCommand = "cat /var/trust/borg/posixlycorrect_passphrase";
};
compression = "auto,lz4";
prune = {
keep = {
hourly = 24;
daily = 7;
weekly = 4;
monthly = 12;
yearly = 99;
};
};
extraArgs = [
"--remote-path=borg14"
];
};
};
environment.sessionVariables.BORG_REMOTE_PATH = "borg14";
}

View file

@ -9,6 +9,7 @@
flakes.home-manager.nixosModules.home-manager
flakes.impermanence.nixosModule
./hardware-configuration.nix
./borg.nix
];
local.sys = {