config: add borg backups
This commit is contained in:
parent
02529ca146
commit
db1e3dcdc6
2 changed files with 47 additions and 0 deletions
46
sys/platforms/posixlycorrect/borg.nix
Normal file
46
sys/platforms/posixlycorrect/borg.nix
Normal 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";
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
flakes.home-manager.nixosModules.home-manager
|
||||
flakes.impermanence.nixosModule
|
||||
./hardware-configuration.nix
|
||||
./borg.nix
|
||||
];
|
||||
|
||||
local.sys = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue