aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/src/expressions/builtin-constants.md
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-08-24 14:31:10 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-08-24 14:31:10 +0200
commita990f063ff7afc6028ab430170ad23e1285d1a6d (patch)
treefe58e282a6a402c95ce2d023c2fa884915ecf287 /doc/manual/src/expressions/builtin-constants.md
parent33b1679d75f2a3a5dac053431a41897ebf96a3f3 (diff)
Move primop docs inline
This makes them available to 'nix repl'.
Diffstat (limited to 'doc/manual/src/expressions/builtin-constants.md')
-rw-r--r--doc/manual/src/expressions/builtin-constants.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/manual/src/expressions/builtin-constants.md b/doc/manual/src/expressions/builtin-constants.md
new file mode 100644
index 000000000..3345a715b
--- /dev/null
+++ b/doc/manual/src/expressions/builtin-constants.md
@@ -0,0 +1,20 @@
+# 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.,
+
+ ```nix
+ if builtins ? getEnv then builtins.getEnv "PATH" else ""
+ ```
+
+ This allows a Nix expression to fall back gracefully on older Nix
+ installations that don’t have the desired built-in function.
+
+ - `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"`.