From b9e47844d90170d15e7d266602d689ad2df1c10d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 19 Dec 2024 20:13:32 +0100 Subject: [PATCH] clanModules/borgbackup: make backup directory configurable This is useful if your have external storage for it. --- clanModules/borgbackup/roles/server.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clanModules/borgbackup/roles/server.nix b/clanModules/borgbackup/roles/server.nix index 0e01aa293..c891fd4e7 100644 --- a/clanModules/borgbackup/roles/server.nix +++ b/clanModules/borgbackup/roles/server.nix @@ -22,6 +22,15 @@ let ) [ ] instances; in { + options = { + clan.borgbackup.directory = lib.mkOption { + type = lib.types.str; + default = "/var/lib/borgbackup"; + description = '' + The directory where the borgbackup repositories are stored. + ''; + }; + }; config.services.borgbackup.repos = let borgbackupIpMachinePath = machines: machineDir + machines + "/facts/borgbackup.ssh.pub"; @@ -44,7 +53,7 @@ in hosts = builtins.map (machine: { name = machine; value = { - path = "/var/lib/borgbackup/${machine}"; + path = "${config.clan.borgbackup.directory}/${machine}"; authorizedKeys = [ (builtins.readFile (borgbackupIpMachinePath machine)) ]; }; }) machinesWithKey;