nix.dev
nix.dev copied to clipboard
nomenclature surrounding derivations
There's a lot of ambiguity and confusion surrounding the terms "package" and "derivation" currently. It would be good to provide a consistent set of terminology in this book.
The current situation I see in the community:
- "package" is vaguely used to refer to "derivations" (with all the multiplicity of meaning inherent there) which fit the intuitive notion of a package in more typical package managers.
- "derivation" is used to refer to many distinct things in my experience:
- nix files containing nix expressions invoking the
derivationkeyword or other functions which wrap it. These are further subdivided by the external interface the code in the file conforms to:callPackage /path/to/file.nix { ... }import /path/to/file.nix { ... }import /path/to/file.nix
- nix expressions invoking the
derivationkeyword or other functions which wrap it. - nix language values produced by the
derivationkeyword or other functions which wrap it. *.drvfiles in the nix store generated from those expressions- the build process described by the
*.drvfile - the store object produced by the build process
- the store path of that store object
- nix files containing nix expressions invoking the
We need to set some precedents about how we refer to these concepts. Some overloading is probably appropriate, but not this much.
- Packaging/Package:
#292 mention Teaching Tech Together that says: Never hesitate to sacrifice truth for clarity. And Teaching Tech Together mention Hattie Effect Sizes, one of it points are -0.29 for non standard dialect use (that if I get it right is teacher speaking a language uncommon to students) and we usually speak 'academic dialects' where most of our students are more practical (street smart) than academical (book smart)
I wish, I never had to say 'derivation' to anyone.
- "Derivation":
- "nix file with derivations output": I have no idea what we could do here, but in fact is a 'different issue', unlike most programming, nix has a single output (there is a term for that?), for this reason we usually refer to the file as what we expect from it, I'm having this problem trying to explain Flake, a flake.nix file expects an attrset, but adding another node make it verbose...
- "nix expressions invoking the derivation", I think is the same, at least for console/repl
- "nix language values", are the
derivative? - "
*.drvfiles", should be.drv files, like.nix filesaren'tnix', I would change to .lock - "the build process" should be the build process, but I think derivation make sense here.
- "the store object" is the
derivative? - the store path of that store object (that resemble to the first problem now would be derivative)
- "nix file with derivations output": I have no idea what we could do here, but in fact is a 'different issue', unlike most programming, nix has a single output (there is a term for that?), for this reason we usually refer to the file as what we expect from it, I'm having this problem trying to explain Flake, a flake.nix file expects an attrset, but adding another node make it verbose...