From 77a368376ca2674678116c19ab4ba3b3fe32cd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 24 Nov 2025 23:48:34 +0200 Subject: [PATCH] fra1-c: back up headscale too --- hosts/fra1-c/configuration.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/hosts/fra1-c/configuration.nix b/hosts/fra1-c/configuration.nix index a220d3f..c736f4b 100644 --- a/hosts/fra1-c/configuration.nix +++ b/hosts/fra1-c/configuration.nix @@ -13,6 +13,7 @@ in age.secrets = { motiejus-server-passwd-hash.file = ../../secrets/motiejus_server_passwd_hash.age; root-server-passwd-hash.file = ../../secrets/root_server_passwd_hash.age; + borgbackup-password.file = ../../secrets/fwminex/borgbackup-password.age; sasl-passwd.file = ../../secrets/postfix_sasl_passwd.age; ssh8022-server = { file = ../../secrets/ssh8022.age; @@ -111,6 +112,39 @@ in } ]; }; + + btrfsborg = + let + this = "${config.networking.hostName}.${config.networking.domain}"; + rsync-net = "zh2769@zh2769.rsync.net"; + vno3-nk = "borgstor@vno3-nk.jakst.vpn"; + in + { + enable = true; + passwordPath = config.age.secrets.borgbackup-password.path; + sshKeyPath = "/etc/ssh/ssh_host_ed25519_key"; + dirs = + builtins.concatMap + ( + host: + let + prefix = "${host}:${this}"; + in + [ + { + subvolume = "/var/lib"; + repo = "${prefix}-var_lib"; + paths = [ "headscale" ]; + backup_at = "*-*-* 01:00:01 UTC"; + } + ] + ) + [ + rsync-net + vno3-nk + ]; + }; + }; };