From 6be2edaac1210dd3099d9519ac0d0233c67f045a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 31 Jul 2024 11:25:28 +0300 Subject: [PATCH] fwminex: merged backup dirs --- hosts/fwminex/configuration.nix | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/hosts/fwminex/configuration.nix b/hosts/fwminex/configuration.nix index 9ea793a..f7c899a 100644 --- a/hosts/fwminex/configuration.nix +++ b/hosts/fwminex/configuration.nix @@ -105,23 +105,20 @@ in enable = true; passwordPath = config.age.secrets.borgbackup-password.path; sshKeyPath = "/etc/ssh/ssh_host_ed25519_key"; - dirs = [ - # TODO: merge - { - subvolume = "/home"; - repo = "zh2769@zh2769.rsync.net:${config.networking.hostName}.${config.networking.domain}-home-motiejus-annex2"; - paths = [ "motiejus/annex2" ]; - backup_at = "*-*-* 02:30:01 UTC"; - } - { - subvolume = "/home"; - repo = "borgstor@${ - myData.hosts."vno3-rp3b.servers.jakst".jakstIP - }:${config.networking.hostName}.${config.networking.domain}-home-motiejus-annex2"; - paths = [ "motiejus/annex2" ]; - backup_at = "*-*-* 02:30:01 UTC"; - } - ]; + dirs = + builtins.concatMap + (host: [ + { + repo = "${host}:${config.networking.hostName}.${config.networking.domain}-home-motiejus-annex2"; + subvolume = "/home"; + paths = [ "motiejus/annex2" ]; + backup_at = "*-*-* 02:30:01 UTC"; + } + ]) + [ + "zh2769@zh2769.rsync.net" + "borgstor@${myData.hosts."vno3-rp3b.servers.jakst".jakstIP}" + ]; }; btrfssnapshot = {