I’m still climbing Nix’s cliff of an onboarding process (I’m guessing I’m about halfway up).
One thing I’m having a some trouble pinning down in my mind is exactly what a module is in relation to a flake, and how both of those interact with nix files, functions, and expressions. And what can include what else in each other. (I think mainly because all these things don’t have easily readable “THIS IS A MODULE/FUNCTION/FLAKE” lines at the top of a file, and instead must be inferred from structure)
Are there any convenient reference diagrams that show the relations between these things, and how to identify them if I’m looking at them?
As near as I can tell so far:
- All
.nix
files are nix expressions - A
.nix
file may be a function - A
.nix
file may be a module- A module may also be a function
- A
.nix
file may be a flake- Every flake is a function
- A nix expression can include another
.nix
file with the builtininclude
function - A nix module can include other modules with the different-from-the-builtin
includes
list of other modules. - Flakes can include modules
- Flakes can include other flakes
- Flakes can produce modules as output?
Having all this stuff in quick-reference diagram form would be really helpful