Commit 545eb50c authored by Silvan Mosberger's avatar Silvan Mosberger
Browse files

ci/update-pinned-nixpkgs.sh: Allow setting the rev

This script only needs to make sure that the revision has the relevant
packages built, it doesn't necessarily need to be a channel version.
This commit makes it possible to set the revision explicitly when
calling the update script.
parent a0812b38
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -10,7 +10,8 @@ repo=https://github.com/nixos/nixpkgs
branch=nixpkgs-unstable
file=$SCRIPT_DIR/pinned-nixpkgs.json

rev=$(git ls-remote "$repo" refs/heads/"$branch" | cut -f1)
defaultRev=$(git ls-remote "$repo" refs/heads/"$branch" | cut -f1)
rev=${1:-$defaultRev}
sha256=$(nix-prefetch-url --unpack "$repo/archive/$rev.tar.gz" --name source)

jq -n --arg rev "$rev" --arg sha256 "$sha256" '$ARGS.named' | tee /dev/stderr > $file