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: |
|
Discussed in the Nix team meeting:
|
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
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-hashwith 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/**.shsrc/*/tests