NixCon 2024

hashes all the way down
2024-10-25 , Arena

Nix and similar systems are based on hashing their inputs.
I took a really close look at how this works, and I'd like to help you understand it better as well.


It's quite difficult to really understand how the hashing of build inputs works in Nix.
I think one of the reasons for this is that people talking about this, and also the terminology that they use (e.g. content-addressing vs input-addressing), is not about how build inputs are hashed, but about how contents of the Nix store are addressed.
The way Nix is designed, those things are related, but how they are related is complicated, and I don't think we have good terminology for the bits and pieces involved in the hashing part.

So, ... I took some definitions from the Build Systems à la Carte paper, which explain this, added a few definitions of my own, so we can name and talk about the bits and pieces involved, and I'm going to walk you through that.
If that does not sound like fun to you, think of it more as us delving into the abyss of terminology and pedantry together. I am pretty sure there are quite a few people at NixCon who find that appealing.

If you get stuck in said abyss, come talk to me. I am happy to spend NixCon just explaining this over and over again.


What level of experience in Nix is the talk addressed to?

Understanding the entire talk right away might require quite a bit of familiarity with Nix.
If Nix is relatively new to you, expect to spend some extra time with the recording, slides or speaker, to understand all the details.

Knowing what hashes, dependency trees and recursion are will be required to follow along.

Do you allow your talk to be recorded? – yes
See also: Slides (1.4 MB)

Martin Schwaighofer is a PhD student at JKU in Austria, interested in proving the link between a running system and it's source code.

This speaker also appears in: