diff --git a/clanModules/borgbackup.nix b/clanModules/borgbackup.nix index 419e8dc0..b3979da1 100644 --- a/clanModules/borgbackup.nix +++ b/clanModules/borgbackup.nix @@ -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: ''