vendorhash calc automation

This commit is contained in:
41666 2025-03-24 23:21:33 -07:00
parent e1909b04b2
commit 1321374a90
7 changed files with 40 additions and 52 deletions

10
scripts/update-vendor-hash.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix -p coreutils -p gnused -p gawk
set -exuo pipefail
go mod tidy
failedbuild=$(nix build --impure --expr '(with import <nixpkgs> {}; pkgs.callPackage ./. { vendorHash = ""; }).roleypoly' 2>&1 || true)
echo "$failedbuild"
checksum=$(echo "$failedbuild" | awk '/got:.*sha256/ { print $2 }')
sed -i -e "s|vendorHash ? \".*\"|vendorHash ? \"$checksum\"|" default.nix