Skip to content

Commit 6480502

Browse files
committed
fix hash calc
1 parent 115881f commit 6480502

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mongodb.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ let
5757
(mirror: ''
5858
echo "Trying to download from ${mirror}${buildDownloadUrl system version}"
5959
SSL_CERT_FILE="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" ${pkgs.curl}/bin/curl -o $out ${mirror}${buildDownloadUrl system version} || true
60-
hash=$(${pkgs.busybox}/bin/busybox sha256sum $out | ${pkgs.gawk}/bin/awk '{print $1}')
60+
hash=$(${pkgs.nix}/bin/nix --extra-experimental-features nix-command --extra-experimental-features flakes hash file $out --type sha256)
61+
echo "Got hash $hash , expect ${expectedHash}"
6162
if [ "$hash" == "${expectedHash}" ]; then
6263
echo "Download success"
6364
exit 0
6465
fi
66+
exit 1
6567
'')
6668
mirrors);
6769
outputHashMode = "flat";

0 commit comments

Comments
 (0)