Talk: Update a package
From NixOS Wiki
Outdated hashing practice
I think the page is currently outdated with regards to hashing best practices. I tried following the page to update the zettlr package but it uses an SRI hash instead of directly sha256, and so does the current i3 package definition.
The page recommends to use nix-prefetch-url
but that outputs a raw sha256 hash, while it is possible to convert the output to a proper SRI hash using
$ nix-prefetch-url 'http://i3wm.org/downloads/i3-4.5.1.tar.bz2' | xargs nix hash to-sri --type sha256
I feel the page would benefit from being updated to use nix store prefetch-file
instead. Both are discussed in https://discourse.nixos.org/t/why-does-nix-prefetch-url-not-return-hashes-in-sri-format/18271