forked from clan/clan-core
fix case when we have multiple backup destinations
This commit is contained in:
parent
9383e41d68
commit
5f9d3b514b
@ -90,17 +90,19 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.jq ];
|
||||
|
||||
clanCore.backups.providers.borgbackup = {
|
||||
# TODO list needs to run locally or on the remote machine
|
||||
|
||||
list = ''
|
||||
set -efu
|
||||
# we need yes here to skip the changed url verification
|
||||
${lib.concatMapStringsSep "\n" (
|
||||
dest: ''
|
||||
yes y | borg-job-${dest.name} list --json | jq '{"backups": [.archives[] | {"name": ("${dest.repo}::" + .name), "job_name": "${dest.name}"}]}'
|
||||
''
|
||||
) (lib.attrValues cfg.destinations)}
|
||||
${
|
||||
lib.concatMapStringsSep "\\\n" (
|
||||
dest:
|
||||
''yes y | borg-job-${dest.name} list --json | jq '[.archives[] | {"name": ("${dest.repo}::" + .name), "job_name": "${dest.name}"}]' ''
|
||||
) (lib.attrValues cfg.destinations)
|
||||
} | jq -s 'add'
|
||||
'';
|
||||
create = ''
|
||||
${lib.concatMapStringsSep "\n" (dest: ''
|
||||
|
Loading…
Reference in New Issue
Block a user