about summary refs log tree commit diff
path: root/pkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh')
-rwxr-xr-xpkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/pkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh b/pkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh
index 3e44cf35b0d27..b2bc629e86604 100755
--- a/pkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh
+++ b/pkgs/test/nixpkgs-check-by-name/scripts/update-pinned-tool.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env nix-shell
-#!nix-shell -i bash -p jq
+#!nix-shell -i bash -p jq -I nixpkgs=../../../..
 
 set -o pipefail -o errexit -o nounset
 
@@ -7,6 +7,9 @@ trace() { echo >&2 "$@"; }
 
 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
 
+# Determined by `runs-on: ubuntu-latest` in .github/workflows/check-by-name.yml
+CI_SYSTEM=x86_64-linux
+
 channel=nixos-unstable
 pin_file=$SCRIPT_DIR/pinned-tool.json
 
@@ -19,13 +22,19 @@ trace "$nixpkgs"
 rev=$(<"$nixpkgs/.git-revision")
 trace -e "Git revision of channel $channel is \e[34m$rev\e[0m"
 
-
-trace -n "Fetching the prebuilt version of nixpkgs-check-by-name.. "
-path=$(nix-build --no-out-link "$nixpkgs" -A tests.nixpkgs-check-by-name -j 0 | tee /dev/stderr)
+trace -n "Fetching the prebuilt version of nixpkgs-check-by-name for $CI_SYSTEM.. "
+# This is the architecture used by CI, we want to prefetch the exact path to avoid having to evaluate Nixpkgs
+ci_path=$(nix-build --no-out-link "$nixpkgs" \
+    -A tests.nixpkgs-check-by-name \
+    --arg config '{}' \
+    --argstr system "$CI_SYSTEM" \
+    --arg overlays '[]' \
+    -j 0 \
+    | tee /dev/stderr)
 
 trace "Updating $pin_file"
 jq -n \
     --arg rev "$rev" \
-    --arg path "$path" \
+    --arg ci-path "$ci_path" \
     '$ARGS.named' \
     > "$pin_file"