nix-super/doc/manual/src/expressions/builtin-constants.md
Jan Tojnar 7708a34a51 doc: Add anchors to long lists
Added using the following sed scripts:

- For command-ref/opt-common.md:

    s~- `(--?)([^`]+)`~- [`\1\2`]{#opt-\2}~g

- For expressions/builtin-constants.md:

    s~- `(builtins\.?)([^`]+)`~- [`\1\2`]{#builtins-\2}~g

- For expressions/advanced-attributes.md

    s~^  - `([^`]+)`~  - [`\1`]{#adv-attr-\1}~g

  and manually adjusted outputHashAlgo & outputHashMode.

- For glossary.md

    s~^  - (`([^`]+)`|(.+)) ?\\~  - [\1]{#gloss-\2\3}\\~g;
    s~(gloss-\w+) ~\1-~g

  and manually adjusted anchors for Nix expression, user environment, NAR, ∅ and ε.

- For command-ref/env-common.md

    s~^  - `([^`]+)`~  - [`\1`]{#env-\1}~g'
2022-05-26 18:17:21 +02:00

764 B
Raw Blame History

Built-in Constants

Here are the constants built into the Nix expression evaluator:

  • builtins
    The set builtins contains all the built-in functions and values. You can use builtins to test for the availability of features in the Nix installation, e.g.,

    if builtins ? getEnv then builtins.getEnv "PATH" else ""
    

    This allows a Nix expression to fall back gracefully on older Nix installations that dont have the desired built-in function.

  • [builtins.currentSystem]{#builtins-currentSystem}
    The built-in value currentSystem evaluates to the Nix platform identifier for the Nix installation on which the expression is being evaluated, such as "i686-linux" or "x86_64-darwin".