Stolen Syntax: Difference between revisions
Appearance
m Add a reasoning for the page name. Reasoning assumed from context here. |
formatting |
||
| Line 8: | Line 8: | ||
== Nix language == | == Nix language == | ||
* outPath | * <code>outPath</code> | ||
* __functor | * <code>__functor</code> | ||
* __toString | * <code>__toString</code> | ||
== nix-build == | == nix-build == | ||
* recurseForDerivations | * <code>recurseForDerivations</code> | ||
== The wider ecosystem == | == The wider ecosystem == | ||
* _type for nominal typing. Should contain a string. Pioneered by the module system (?) | * <code>_type</code> for nominal typing. Should contain a string. Pioneered by the module system (?) | ||
* | * <del><code>type</code></del> in principle this one is available for domain specific use! That is, unless you want the attrset to double as a "derivation" in the CLI. | ||
== Module system == | == Module system == | ||
* _type | * <code>_type</code> | ||
* config, options (etc) (switches away from shorthand syntax) | * <code>config</code>, <code>options</code> (etc) (switches away from shorthand syntax) | ||
* _module option tree is omitted from the returned config and is intended for module system specific use | * <code>_module</code> option tree is omitted from the returned config and is intended for module system specific use | ||
* _key | * <code>_key</code> | ||
* _class | * <code>_class</code> | ||
* _file | * <code>_file</code> | ||
* ... | * ... | ||
[[Category:Nix]] | [[Category:Nix]] | ||
Latest revision as of 18:25, 9 June 2026
The Nix language allows any name to be used in an attribute set, but Nix, some libraries, and the ecosystem in general assign special meaning to some names that appear in attribute sets that consist of otherwise freely named variables.
This page presents a cross-section of well known "keywords" used in attribute sets in various components.
Since neither the runtime, not the language reserve these keywords, these keywords are described stolen rather than reserved.
Nix language
outPath__functor__toString
nix-build
recurseForDerivations
The wider ecosystem
_typefor nominal typing. Should contain a string. Pioneered by the module system (?)in principle this one is available for domain specific use! That is, unless you want the attrset to double as a "derivation" in the CLI.type
Module system
_typeconfig,options(etc) (switches away from shorthand syntax)_moduleoption tree is omitted from the returned config and is intended for module system specific use_key_class_file- ...