
What does the hash in a /nix/store path actually name? (not always "the inputs")
"The hash comes from the inputs" is the usual answer, and it's incomplete — it never says what Nix hashed: the file you wrote, the derivation it evaluates to, the built bytes, or the dependencies.
- Most package paths are input-addressed. Nix names the output from the derivation (the concrete build recipe) before the build runs. That's why editing a .nix file doesn't always move the path — two expressions can evaluate to the same recipe — and why changing a real recipe input does.
- Some paths are content-addressed. `nix store add` hashes bytes that already exist. Both live under /nix/store, so calling every store path "content-addressed" misses the split.
The name is also only part of the record: built paths reference other paths, Nix records the graph, and the closure is everything that must travel with a path to another machine.
Disclosure: I build LabCraft, and I just shipped this as a free, hands-on lesson. You inspect a real NixOS machine (the OS itself is the biggest store object) and predict what moves a path before the machine answers. No Nix language required: https://www.labcraft.dev/blog/nix-store-paths?utm_source=reddit-personal&utm_medium=social&utm_campaign=nix-store-paths-2026q3&utm_content=r-nixos-hash-names-01