btrfsborg: compression, rm timelapse from rsync.net

This commit is contained in:
2025-03-15 19:41:36 +00:00
parent fce3ea08ef
commit 4059674d35
3 changed files with 75 additions and 47 deletions

View File

@@ -573,21 +573,31 @@ in
};
};
btrfsborg = {
enable = true;
passwordPath = config.age.secrets.borgbackup-password.path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
dirs =
builtins.concatMap
(
host:
let
prefix = "${host}:${config.networking.hostName}.${config.networking.domain}";
in
[
btrfsborg =
let
this = "${config.networking.hostName}.${config.networking.domain}";
vno3-nk = "borgstor@${myData.hosts."vno3-nk.jakst.vpn".jakstIP}";
rsync-net = "zh2769@zh2769.rsync.net";
in
{
enable = true;
passwordPath = config.age.secrets.borgbackup-password.path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
dirs =
[
{
subvolume = "/var/lib";
repo = "${vno3-nk}:${this}-timelapse-r11";
paths = [ "private/timelapse-r11" ];
backup_at = "*-*-* 02:01:00 UTC";
compression = "none";
}
]
++ (builtins.concatMap
(host: [
{
subvolume = "/var/lib";
repo = "${prefix}-var_lib";
repo = "${host}:${this}-var_lib";
paths = [
"hass"
"gitea"
@@ -597,7 +607,6 @@ in
"bitwarden_rs"
"matrix-synapse"
"private/soju"
"private/timelapse-r11"
# https://immich.app/docs/administration/backup-and-restore/
"immich/library"
@@ -610,17 +619,17 @@ in
}
{
subvolume = "/home";
repo = "${prefix}-home-motiejus-annex2";
repo = "${host}:${this}-home-motiejus-annex2";
paths = [ "motiejus/annex2" ];
backup_at = "*-*-* 02:30:01 UTC";
}
])
[
rsync-net
vno3-nk
]
)
[
"zh2769@zh2769.rsync.net"
"borgstor@${myData.hosts."vno3-nk.jakst.vpn".jakstIP}"
];
};
);
};
btrfssnapshot = {
enable = true;

View File

@@ -125,31 +125,47 @@ in
verboseLogs = false;
};
btrfsborg = {
enable = true;
passwordPath = config.age.secrets.borgbackup-password.path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
dirs =
builtins.concatMap
(
host:
let
prefix = "${host}:${config.networking.hostName}.${config.networking.domain}";
in
btrfsborg =
let
this = "${config.networking.hostName}.${config.networking.domain}";
rsync-net = "zh2769@zh2769.rsync.net";
fwminex = "borgstor@${myData.hosts."fwminex.jakst.vpn".jakstIP}";
in
{
enable = true;
passwordPath = config.age.secrets.borgbackup-password.path;
sshKeyPath = "/etc/ssh/ssh_host_ed25519_key";
dirs =
#[
#{
# subvolume = "/data";
# repo = "${fwminex}:${this}-timelapse-r11";
# paths = [ "timelapse-r11" ];
# backup_at = "*-*-* 02:01:00 UTC";
# compression = "none";
#}
#] ++ (
builtins.concatMap
(
host:
let
prefix = "${host}:${this}";
in
[
{
subvolume = "/data";
repo = "${prefix}-data";
paths = [ "vno3-shared" ];
backup_at = "*-*-* 01:00:01 UTC";
}
]
)
[
{
subvolume = "/data";
repo = "${prefix}-data";
paths = [ "vno3-shared" ];
backup_at = "*-*-* 01:00:01 UTC";
}
]
)
[
"zh2769@zh2769.rsync.net"
"borgstor@${myData.hosts."fwminex.jakst.vpn".jakstIP}"
];
};
rsync-net
fwminex
];
#);
};
btrfssnapshot = {
enable = true;

View File

@@ -33,6 +33,10 @@ in
default = { };
};
backup_at = lib.mkOption { type = str; };
compression = lib.mkOption {
type = str;
default = "auto,zstd,10";
};
};
});
};
@@ -59,7 +63,7 @@ in
"config.mj.base.unitstatus.enable must be true";
lib.nameValuePair "${lib.strings.sanitizeDerivationName subvolume}-${toString i}" (
{
inherit (attrs) repo paths;
inherit (attrs) repo paths compression;
doInit = true;
encryption = {
@@ -67,7 +71,6 @@ in
passCommand = "cat ${cfg.passwordPath}";
};
extraArgs = "--remote-path=borg1";
compression = "auto,zstd,10";
extraCreateArgs = "--chunker-params buzhash,10,23,16,4095";
startAt = attrs.backup_at;
preHook = ''