1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

grafana: fix update script

This commit is contained in:
Weijia Wang 2023-09-21 23:47:30 +02:00
parent e12483116b
commit dd52d0fc96

View file

@ -28,9 +28,10 @@ if [ ! "${oldVersion}" = "${targetVersion}" ]; then
update-source-version grafana "${targetVersion#v}"
oldStaticHash="$(nix-instantiate --eval -A grafana.srcStatic.outputHash | tr -d '"')"
newStaticHash="$(nix-prefetch-url "https://dl.grafana.com/oss/release/grafana-${targetVersion#v}.linux-amd64.tar.gz")"
newStaticHash="$(nix hash to-sri --type sha256 $newStaticHash)"
replaceHash "$oldStaticHash" "$newStaticHash"
goHash="$(nix-instantiate --eval -A grafana.vendorSha256 | tr -d '"')"
emptyHash="$(nix-instantiate --eval -A lib.fakeSha256 | tr -d '"')"
goHash="$(nix-instantiate --eval -A grafana.vendorHash | tr -d '"')"
emptyHash="$(nix-instantiate --eval -A lib.fakeHash | tr -d '"')"
replaceHash "$goHash" "$emptyHash"
replaceHash "$emptyHash" "$(extractVendorHash "$goHash")"
nix-build -A grafana