Fix broken genJqSecretsReplacementSnippet for jq 1.7 (#257932)

jq 1.7 updated it's behaviour and now throws an error
if the first argument is an empty string. It now needs
"." to pass the input through.

authored by Reno Reckling and committed by GitHub 612035c4 31871e17

+7 -4
+7 -4
nixos/lib/utils.nix
··· 177 177 genJqSecretsReplacementSnippet' = attr: set: output: 178 178 let 179 179 secrets = recursiveGetAttrWithJqPrefix set attr; 180 + stringOrDefault = str: def: if str == "" then def else str; 180 181 in '' 181 182 if [[ -h '${output}' ]]; then 182 183 rm '${output}' ··· 195 196 (attrNames secrets)) 196 197 + "\n" 197 198 + "${pkgs.jq}/bin/jq >'${output}' " 198 - + lib.escapeShellArg (concatStringsSep 199 - " | " 200 - (imap1 (index: name: ''${name} = $ENV.secret${toString index}'') 201 - (attrNames secrets))) 199 + + lib.escapeShellArg (stringOrDefault 200 + (concatStringsSep 201 + " | " 202 + (imap1 (index: name: ''${name} = $ENV.secret${toString index}'') 203 + (attrNames secrets))) 204 + ".") 202 205 + '' 203 206 <<'EOF' 204 207 ${builtins.toJSON set}