vps: enable borg backups

This commit is contained in:
Fabian Montero 2025-08-27 18:55:31 -06:00
parent 943deed8bd
commit db0040dcf4
Signed by: fabian
GPG key ID: 1FFAC35E1798174F
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{
config,
pkgs,
lib,
flakes,
...
}: {
services.borgbackup.jobs = {
rsync = {
paths = [
"/var/lib/forgejo"
"/var/lib/mealie"
"/var/lib/trilium"
];
exclude = [
];
user = "root";
group = "root";
doInit = true;
startAt = [
"hourly"
];
inhibitsSleep = true;
persistentTimer = true;
repo = "zh5777@zh5777.rsync.net:vps";
encryption = {
mode = "repokey-blake2";
passCommand = "cat /var/trust/borg/vps_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

@ -15,6 +15,7 @@ with lib; {
./hardware-configuration.nix
./srv
./networkMap.nix
./borg.nix
];
local.sys = {

View file

@ -22,6 +22,7 @@ with lib; {
host = "127.0.0.1";
port = 8458;
noAuthentication = false;
noBackup = true; # I already backup the whole dataDir, so no need for this
instanceName = "posixlycorrect";
dataDir = "/var/lib/trilium";
nginx = {