For context, this particular article is a cool deep dive into how Nix <i>works</i>, but it doesn't represent what using Nix + Nixpkgs is like in practice. I've been using Nix personally and professionally for almost 10 years now (yikes has time passed quickly!) and I have never needed to operate at the level of derivations like this.
What I found hard with Nix is the sheer amount of things I had to get familiar with before it started to really click:<p>- nix, the command-line tool<p>- nix, the language<p>- nixpkgs with the general API/idioms (overriding, overlays)<p>- individual nixpkgs packages that sometimes deviate from common practices<p>- flakes (which I haven't properly looked into yet)<p>The Nix pills series [1] and nixpkgs documentation [2] do help a lot, but that is quite a lot to process.<p>[1] <a href="https://nixos.org/guides/nix-pills" rel="nofollow">https://nixos.org/guides/nix-pills</a><p>[2] <a href="https://nixos.org/manual/nixpkgs/stable/" rel="nofollow">https://nixos.org/manual/nixpkgs/stable/</a>
What a fun read. Thanks for the nice call out on my blog.<p>If you're also interested I (Farid) also had a follow up where I follow up on how the hashes are calculated.
(Using the error to get the hashes also bugged me)<p>I use it to also create vanity hashes :)<p><a href="https://fzakaria.com/2025/03/28/what-s-in-a-nix-store-path" rel="nofollow">https://fzakaria.com/2025/03/28/what-s-in-a-nix-store-path</a><p><a href="https://fzakaria.com/2025/03/27/nix-vanity-store-paths" rel="nofollow">https://fzakaria.com/2025/03/27/nix-vanity-store-paths</a>
Ah, don't you just like it when projects that use hashsums, calculate them in such a way that you can't actually recalculate them on your own? And when you start digging, you find not only that it uses the same basic design of XML-DSig while <i>barely</i> escaping its fatal flaws, it also uses some bizarre data encodings nobody else uses for anything. And then the resulting hash is not even the truncation of the actual hash, it has an additional (again, entirely undocumented) strange post-processing step for unspecified reasons.
Nix derivations are pretty neat!<p>I've been building a Nix store navigator for MyNixOS v2. It can help you get a feel for how derivations are connected in Nix:<p><a href="https://v2.mynixos.com/nix/store/lsk1c4v03y4lmpxdcwal99nm5nwz2rj7-texlive-2024-env.drv" rel="nofollow">https://v2.mynixos.com/nix/store/lsk1c4v03y4lmpxdcwal99nm5nw...</a><p>PS: The controls to the upper right can be used to limit what is downloaded.
Now we are really interested in why they do this—probably for backward compatibility with a 20‑year‑old implementation. It’s not messy, just particular.
Is there any technical pathway for changing the underlying hash function? Similar to how git is kind of stuck on SHA1, what would it take to get this onto SHA512?