What are nix flakes and why should I care?

Another way to say it is: Nix has always been good about being reproducible in regards of a .drv being realized into something useful. However, it’s always had issues with people capturing everything to create a specific derivation. In the old workflow, overlays in the home directory, NIX_PATH, nix-channels, whether it’s the user invoking something or through sudo, and other factors may have contributed to “you got something different on your machine”.

With flakes, everything relevant to building something is expressed in the flake.nix and flake.lock, and you have to explicitly “opt-in” impure behavior so it’s pure by default. So you should have a very high degree of certainty that you will be able to come to the same .drv, and nix has always been good about making a .drv into a reproducible output.

10 Likes