From e37126b0169acd1653ad5b697f718de96d263c18 Mon Sep 17 00:00:00 2001 From: ChaotiCryptidz Date: Fri, 31 Dec 2021 12:40:11 +0000 Subject: [PATCH] add backups to cassie's b2 --- hosts/hetzner-vm/services/restic.nix | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/hosts/hetzner-vm/services/restic.nix b/hosts/hetzner-vm/services/restic.nix index 2f29595..42ff236 100644 --- a/hosts/hetzner-vm/services/restic.nix +++ b/hosts/hetzner-vm/services/restic.nix @@ -1,13 +1,28 @@ -{ ... }: { - services.restic.backups.hetzner-vm = { - user = "root"; - paths = [ "/var/lib/postgresql" "/var/lib/vault" ]; - timerConfig = { +{ ... }: +let + backupUser = "root"; + backupPaths = [ + "/var/lib/postgresql" "/var/lib/vault" + ]; + timerConfig = { OnBootSec = "1m"; OnCalendar = "daily"; }; +in { + services.restic.backups.hetzner-vm = { + user = backupUser; + paths = backupPaths; + timerConfig = timerConfig; repository = "b2:Backups-HetznerVM:/"; passwordFile = "/secrets/restic-password"; environmentFile = "/secrets/restic-env"; }; + services.restic.backups.cassie-hetzner-vm = { + user = backupUser; + paths = backupPaths; + timerConfig = timerConfig; + repository = "b2:Cryptidz-Backup:HetznerVM"; + passwordFile = "/secrets/restic-password-cassie"; + environmentFile = "/secrets/restic-env-cassie"; + }; }