-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nix-hash: support base-64 and SRI format #7690
Conversation
I don't think we should be extending |
I think we're being a bit schizophrenic in (not) recommending the new For example what would you use in a script? A script-local alias that adds the extra enabler and additionally hope that you won't be hit by future incompatibility? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-02-17-nix-team-meeting-minutes-33/25624/1 |
Discussed in the Nix team meeting:
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-10-nix-team-meeting-minutes-39/26279/1 |
cb04b9b
to
a34d173
Compare
a34d173
to
2ae0cf6
Compare
Done. |
2ae0cf6
to
19c1633
Compare
Oops! I didn't read the hacking guide carefully enough. Now the test should pass. |
19c1633
to
7307213
Compare
Do not rely on the "multiple format flag specified" behavior. Explicitly test without the format flag / with the --base16 flag.
7307213
to
81e024e
Compare
Add the --base64 and --sri flags for the Base64 and SRI format output. Add the --base16 flag to explicitly specify the hexadecimal format. Add the --to-base64 and --to-sri flag to convert a hash to the above mentioned format.
bcd6292
to
c27d358
Compare
Thanks @ShamrockLee. This is nicely done. |
Motivation
This PR provides
nix-hash
with base-64 and SRI format support, equivalent to that ofnix hash
.If applied, users with a
nix-channel
-based setup would be able to compute hashes in base-64 and SRI format without having to typenix --extra-experimental-features hash ...
Context
Solves #7688
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests