summaryrefslogtreecommitdiff
path: root/hosts/apocalypse/backup.nix
diff options
context:
space:
mode:
authorJakub Stachurski <j.stachurski@student.utwente.nl>2025-08-17 11:25:33 +0200
committerJakub Stachurski <j.stachurski@student.utwente.nl>2025-08-17 11:25:33 +0200
commit1be972048dd58218cd689ecb5cac562eb398b751 (patch)
tree203f19ee01ad5fe28f2868e8c1451f9538e4ab12 /hosts/apocalypse/backup.nix
parent3cd59d4670711e34a50adea912c3b0894883e490 (diff)
refreshed config
Diffstat (limited to 'hosts/apocalypse/backup.nix')
-rw-r--r--hosts/apocalypse/backup.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/hosts/apocalypse/backup.nix b/hosts/apocalypse/backup.nix
new file mode 100644
index 0000000..3529024
--- /dev/null
+++ b/hosts/apocalypse/backup.nix
@@ -0,0 +1,31 @@
+{ config, lib, pkgs, modulesPath, ...}:
+{
+ environment.systemPackages = with pkgs; [
+ btrbk
+ lz4
+ ];
+
+ services.btrbk = {
+ extraPackages = with pkgs; [ lz4 ];
+ instances."remote_vault" = {
+ onCalendar = "weekly";
+ settings = {
+ snapshot_preserve_min = "1w";
+ snapshot_preserve = "2w";
+ target_preserve_min = "1w";
+ target_preserve = "4w";
+ ssh_identity = "/etc/vault_key"; # NOTE: must be readable by user/group btrbk
+ ssh_user = "vaultmanager";
+ stream_compress = "lz4";
+ volume."/btrfs_root" = {
+ target = "ssh://10.127.9.1/vault/backups/apocalypse";
+ subvolume = {
+ "@root" = {
+ snapshot_create = "ondemand";
+ };
+ };
+ };
+ };
+ };
+};
+}