I’ve written an overview of the most common(and some of the less common) components of a flake.nix file here.
There’s quite a lot of details about flakes’ inputs and outputs and how they all work together. There’s also some common code patterns that one might encounter when using flakes but ones that I haven’t seen in detail.
While the guide does require some initial knowledge of nix and flakes, I tried to make the sections as non-convoluted and self-contained as possible.
This is very good. I’ve had several questions about how flakes operate but never known how to tackle them (combine with lack of time and incentive…), but this pushed me over;
I’m using it to modularize my infrastructures and creating tests. Thanks for taking the time to write it.
There is one point I’d want to mention, and that’s to discourage the use of the registry, as that can break eval for others if that registry entry points to a store path.
Possibly devShell.<system> and defaultPackage.<system> are worth a mention too, despite their deprecation, to clarify what people should use instead.
I’d love to see the content from this upstreamed to https://www.nix.dev! Documentation on the internals of flakes is sorely lacking within the community, and this would be a great step to improve that.