Skip to content
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

Support base-64 and SRI in nix-hash #7688

Closed
ShamrockLee opened this issue Jan 25, 2023 · 0 comments
Closed

Support base-64 and SRI in nix-hash #7688

ShamrockLee opened this issue Jan 25, 2023 · 0 comments
Labels
cli The old and/or new command line interface feature Feature request or proposal new-cli Relating to the "nix" command

Comments

@ShamrockLee
Copy link
Contributor

Is your feature request related to a problem? Please describe.
SRI hashes are becoming more and more popular. It enables the use of hash attribute to pass the hash to the fetcher, making it easier to switch to a safer algorithm in the future. Besides, the base-64 coding is more standardized than the base-32 coding.

The Nix command-line interface currently provide support through

nix hash file --base64 path/to/file
nix hash file --sri path/to/file
nix hash path --base64 path/to/file
nix hash path --sri path/to/file
nix hash to-base64 theHash
nix hash to-sri theHash

but that requires enabling the nix-command experimental feature.

Describe the solution you'd like

nix-hash [--flat] --base64 path/to/file
nix-hash [--flat] --sri path/to/file
nix-hash --to-base64 theHash
nix-hash --to-sri theHash

Describe alternatives you've considered
Do nothing and keep forcing the non-flakers to type

nix --extra-experimental-features nix-command nix hash ...

Additional context
Eelco Dostra's comment recommending the use of SRI hashes: #4354 (comment)
Théo Zimmermann's comment about the lack of this feature NixOS/rfcs#131 (comment)
A Nix RFC proposal (0131) to enforce the use of SRI hashes: NixOS/rfcs#131

Priorities

Add 👍 to issues you find important.

@ShamrockLee ShamrockLee added the feature Feature request or proposal label Jan 25, 2023
@roberth roberth added new-cli Relating to the "nix" command cli The old and/or new command line interface labels Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli The old and/or new command line interface feature Feature request or proposal new-cli Relating to the "nix" command
Projects
None yet
Development

No branches or pull requests

2 participants