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

nix-prefetch-url: support SRI hashes directly #10990

Open
eclairevoyant opened this issue Jun 29, 2024 · 2 comments
Open

nix-prefetch-url: support SRI hashes directly #10990

eclairevoyant opened this issue Jun 29, 2024 · 2 comments
Labels
cli The old and/or new command line interface feature Feature request or proposal fetching Networking with the outside (non-Nix) world, input locking

Comments

@eclairevoyant
Copy link
Member

Is your feature request related to a problem? Please describe.
Currently, using SRI hashes with nix-prefetch-url require an invocation such as:

nix-prefetch-url <url> --type sha256 | xargs nix hash convert --hash-algo sha256

Describe the solution you'd like
It'd be far more convenient to have a flag to output SRI hashes directly, e.g.

nix-prefetch-url <url> --type sha256 --as-sri

Or alternatively, use SRI hashes by default, since they're the preferred type in nixpkgs anyway.

Describe alternatives you've considered
see above

Additional context

Priorities

Add 👍 to issues you find important.

@eclairevoyant eclairevoyant added the feature Feature request or proposal label Jun 29, 2024
@roberth roberth added cli The old and/or new command line interface fetching Networking with the outside (non-Nix) world, input locking labels Jul 1, 2024
@Chatchaton
Copy link

having a subcommand nix prefetch-url with --as-sri as the default behavior would be nice

@edolstra
Copy link
Member

nix store prefetch-file prints an SRI hash, maybe that works for you?

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 fetching Networking with the outside (non-Nix) world, input locking
Projects
None yet
Development

No branches or pull requests

4 participants