clanModules/borgbackup: make backup directory configurable
This is useful if your have external storage for it.
This commit is contained in:
@@ -22,6 +22,15 @@ let
|
|||||||
) [ ] instances;
|
) [ ] instances;
|
||||||
in
|
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 =
|
config.services.borgbackup.repos =
|
||||||
let
|
let
|
||||||
borgbackupIpMachinePath = machines: machineDir + machines + "/facts/borgbackup.ssh.pub";
|
borgbackupIpMachinePath = machines: machineDir + machines + "/facts/borgbackup.ssh.pub";
|
||||||
@@ -44,7 +53,7 @@ in
|
|||||||
hosts = builtins.map (machine: {
|
hosts = builtins.map (machine: {
|
||||||
name = machine;
|
name = machine;
|
||||||
value = {
|
value = {
|
||||||
path = "/var/lib/borgbackup/${machine}";
|
path = "${config.clan.borgbackup.directory}/${machine}";
|
||||||
authorizedKeys = [ (builtins.readFile (borgbackupIpMachinePath machine)) ];
|
authorizedKeys = [ (builtins.readFile (borgbackupIpMachinePath machine)) ];
|
||||||
};
|
};
|
||||||
}) machinesWithKey;
|
}) machinesWithKey;
|
||||||
|
|||||||
Reference in New Issue
Block a user