Nix: Make prefetch auto-copy the hash.

This commit is contained in:
Dmitry Voronin 2024-11-06 04:26:44 +03:00
parent fa4a5bce58
commit 3fb91b5afb
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k

View file

@ -57,7 +57,9 @@
return 2 return 2
fi fi
nix hash to-sri --type sha256 $(nix-prefetch-url "''${url}") local result=$(nix hash to-sri --type sha256 $(nix-prefetch-url "''${url}"))
printf "%s" ''${result} | copy
printf "%s\n" ''${result}
} }
# Run nix locally with no builders. # Run nix locally with no builders.