Skip to content

Commit e8e6000

Browse files
committed
fix(devshell/ci): allow IFD and fix missing substitution for jq
Seems like something changed and now IFD needs to be explicitly enabled.
1 parent ed6bcb6 commit e8e6000

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

devshell/ci/scripts/default.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
parallel
1212
];
1313
fix = {
14-
# Workaround to get `resholve` to substitute the `nix` called by `parallel`
14+
# Workaround to get `resholve` to substitute the `nix` and `jq` called by `parallel`
1515
"$NIX_COMMAND" = [ "${pkgs.nix}/bin/nix" ];
16+
"$JQ_COMMAND" = [ "${pkgs.jq}/bin/jq" ];
1617
};
1718
execer = [
1819
"cannot:${pkgs.nix}/bin/nix"

devshell/ci/scripts/generate-deploy-spec-matrix.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ usage() {
1313
}
1414

1515
# Workaround for `resholve`.
16-
# The `nix` invoked by `parallel` does not get substituted otherwise.
16+
# The `nix` and `jq` invoked by `parallel` do not get substituted otherwise.
1717
NIX_COMMAND="nix"
18+
JQ_COMMAND="jq"
1819

1920
CI_ATTR="ci"
2021
CI_SUFFIX_REGEX="\"^$CI_ATTR.\""
2122

2223
# JSON array of the flake outputs under `ci` e.g., `["ci.alpha-deploy-spec","ci.bravo-deploy-spec"]`
2324
ci_outputs_json() {
24-
nix search "$1#$CI_ATTR" --json |
25+
nix search "$1#$CI_ATTR" --json --allow-import-from-derivation |
2526
jq -rc 'keys_unsorted'
2627
}
2728

@@ -37,7 +38,7 @@ if [ $# -eq 1 ] || [ $# -eq 2 ]; then
3738
matrix=$(
3839
ci_outputs_json "$1" |
3940
jq -rc '.[]' |
40-
parallel "$NIX_COMMAND" path-info "$1#{}" --json '|' jq -c --arg FLAKE_OUTPUT '{}' "$PATH_INFO_FILTER" |
41+
parallel "$NIX_COMMAND" path-info "$1#{}" --json --allow-import-from-derivation '|' "$JQ_COMMAND" -c --arg FLAKE_OUTPUT '{}' "$PATH_INFO_FILTER" |
4142
jq -sc # Combine the JSON objects into an array
4243
)
4344

0 commit comments

Comments
 (0)