secrets.password-store: optimize secret existence check
All checks were successful
checks-impure / test (pull_request) Successful in 13s
checks / test (pull_request) Successful in 24s

This commit is contained in:
lassulus 2023-09-30 09:36:24 +02:00
parent 55743928ae
commit 62caf98f15

View File

@ -28,7 +28,7 @@ in
${acc}
# ${n}
# if any of the secrets are missing, we regenerate all connected facts/secrets
(if ! (${lib.concatMapStringsSep " && " (x: "pass show machines/${config.clanCore.machineName}/${x.name} >/dev/null") (lib.attrValues v.secrets)}); then
(if ! (${lib.concatMapStringsSep " && " (x: "test -e ${passwordstoreDir}/machines/${config.clanCore.machineName}/${x.name}.gpg >/dev/null") (lib.attrValues v.secrets)}); then
facts=$(mktemp -d)
trap "rm -rf $facts" EXIT