feat: more btrbk things

feat/kile-v2
Ricard Illa 2023-04-26 11:30:08 +02:00
parent 8eb37952f4
commit e7b0d0ba53
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
1 changed files with 28 additions and 8 deletions

View File

@ -6,7 +6,7 @@
let let
home = "/home/rilla"; home = "/home/rilla";
run-offline-backups = pkgs.writeScriptBin "run-offline-backups" '' offline-backups = pkgs.writeScriptBin "offline-backups" ''
#!${pkgs.dash}/bin/dash #!${pkgs.dash}/bin/dash
set -xe set -xe
@ -16,10 +16,10 @@ let
done && \ done && \
/run/wrappers/bin/doas -u btrbk \ /run/wrappers/bin/doas -u btrbk \
${pkgs.btrbk}/bin/btrbk \ ${pkgs.btrbk}/bin/btrbk \
-c /etc/btrbk/offline-backups.conf \ --config /etc/btrbk/offline-backups.conf \
--progress \ --progress \
--verbose \ --verbose \
run "$@"
''; '';
in { in {
@ -163,7 +163,7 @@ in {
# services.thermald.enable = true; # services.thermald.enable = true;
services.tlp.enable = true; services.tlp.enable = true;
services.power-profiles-daemon.enable = false; services.power-profiles-daemon.enable = false;
environment.systemPackages = with pkgs; [ powertop acpi run-offline-backups ]; environment.systemPackages = with pkgs; [ powertop acpi offline-backups ];
#services.beesd.filesystems = { #services.beesd.filesystems = {
# root = { # root = {
@ -199,10 +199,15 @@ in {
ssh_user = "btrbk"; ssh_user = "btrbk";
ssh_identity = "/etc/btrbk/id_ed25519"; ssh_identity = "/etc/btrbk/id_ed25519";
backend_remote = "btrfs-progs-doas"; backend_remote = "btrfs-progs-doas";
snapshot_create = "onchange";
snapshot_preserve_min = "latest";
target_preserve_min = "all";
volume = { volume = {
"ssh://narwhal:22/mnt/btr_pool" = { "ssh://narwhal:22/mnt/btr_pool" = {
snapshot_dir = "btrbk_snapshots"; stream_buffer = "50%";
stream_compress = "zstd";
snapshot_dir = "btrbk_snapshots_offline";
subvolume = { subvolume = {
backups = { }; backups = { };
books = { }; books = { };
@ -225,14 +230,14 @@ in {
}; };
"ssh://suricata:22/mnt/btr_pool" = { "ssh://suricata:22/mnt/btr_pool" = {
snapshot_dir = "btrbk_snapshots"; stream_buffer = "50%";
snapshot_dir = "btrbk_snapshots_offline";
compat_remote = "busybox"; compat_remote = "busybox";
subvolume = { subvolume = {
home = { }; home = { };
rancher_config = { }; rancher_config = { };
backups = { }; backups = { };
configs = { }; configs = { };
}; };
target = { target = {
"/mnt/backups/0/btr_backup/suricata" = { }; "/mnt/backups/0/btr_backup/suricata" = { };
@ -240,8 +245,23 @@ in {
"/mnt/backups/2/btr_backup/suricata" = { }; "/mnt/backups/2/btr_backup/suricata" = { };
}; };
}; };
};
"ssh://10.8.8.2:22/mnt/btr_pool" = {
stream_buffer = "50%";
snapshot_dir = "btrbk_snapshots_offline";
compat_remote = "busybox";
subvolume = {
certs = { };
volumes = { };
};
target = {
"/mnt/backups/0/btr_backup/caladan" = { };
"/mnt/backups/1/btr_backup/caladan" = { };
"/mnt/backups/2/btr_backup/caladan" = { };
};
};
};
}; };
}; };
}; };