diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml
index 873f30b06..8d12da9b1 100644
--- a/doc/manual/expressions/builtins.xml
+++ b/doc/manual/expressions/builtins.xml
@@ -21,7 +21,8 @@ available as builtins.derivation.
- aborts
+
+ abortsAbort Nix expression evaluation, print error
message s.
@@ -29,8 +30,10 @@ available as builtins.derivation.
- builtins.add
- e1e2
+
+ builtins.add
+ e1e2
+ Return the sum of the numbers
e1 and
@@ -39,8 +42,9 @@ available as builtins.derivation.
- builtins.all
- predlist
+
+ builtins.all
+ predlistReturn true if the function
pred returns true
@@ -50,8 +54,9 @@ available as builtins.derivation.
- builtins.any
- predlist
+
+ builtins.any
+ predlistReturn true if the function
pred returns true
@@ -61,8 +66,9 @@ available as builtins.derivation.
- builtins.attrNames
- set
+
+ builtins.attrNames
+ setReturn the names of the attributes in the set
set in an alphabetically sorted list. For instance,
@@ -72,8 +78,9 @@ available as builtins.derivation.
- builtins.attrValues
- set
+
+ builtins.attrValues
+ setReturn the values of the attributes in the set
set in the order corresponding to the
@@ -82,7 +89,8 @@ available as builtins.derivation.
- baseNameOfs
+
+ baseNameOfsReturn the base name of the
string s, that is, everything following
@@ -92,8 +100,9 @@ available as builtins.derivation.
- builtins.bitAnd
- e1e2
+
+ builtins.bitAnd
+ e1e2Return the bitwise AND of the integers
e1 and
@@ -102,8 +111,9 @@ available as builtins.derivation.
- builtins.bitOr
- e1e2
+
+ builtins.bitOr
+ e1e2Return the bitwise OR of the integers
e1 and
@@ -112,8 +122,9 @@ available as builtins.derivation.
- builtins.bitXor
- e1e2
+
+ builtins.bitXor
+ e1e2Return the bitwise XOR of the integers
e1 and
@@ -122,7 +133,8 @@ available as builtins.derivation.
- builtins
+
+ builtinsThe set builtins contains all
the built-in functions and values. You can use
@@ -139,8 +151,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.compareVersions
- s1s2
+
+ builtins.compareVersions
+ s1s2Compare two strings representing versions and
return -1 if version
@@ -156,8 +169,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.splitVersion
- s
+
+ builtins.splitVersion
+ sSplit a string representing a version into its
components, by the same version splitting logic underlying the
@@ -167,16 +181,18 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.concatLists
- lists
+
+ builtins.concatLists
+ listsConcatenate a list of lists into a single
list.
- builtins.concatStringsSep
- separatorlist
+
+ builtins.concatStringsSep
+ separatorlistConcatenate a list of strings with a separator
between each element, e.g. concatStringsSep "/"
@@ -184,8 +200,8 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.currentSystem
+
+ builtins.currentSystemThe built-in value currentSystem
evaluates to the Nix platform identifier for the Nix installation
@@ -218,8 +234,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
-->
- builtins.deepSeq
- e1e2
+
+ builtins.deepSeq
+ e1e2This is like seq
e1
@@ -231,8 +248,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- derivation
- attrs
+
+ derivation
+ attrsderivation is described in
.
@@ -240,7 +258,8 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- dirOfs
+
+ dirOfsReturn the directory part of the string
s, that is, everything before the final
@@ -250,8 +269,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.div
- e1e2
+
+ builtins.div
+ e1e2Return the quotient of the numbers
e1 and
@@ -259,8 +279,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.elem
- xxs
+
+ builtins.elem
+ xxsReturn true if a value equal to
x occurs in the list
@@ -270,8 +291,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.elemAt
- xsn
+
+ builtins.elemAt
+ xsnReturn element n from
the list xs. Elements are counted
@@ -281,8 +303,9 @@ if builtins ? getEnv then builtins.getEnv "PATH" else ""
- builtins.fetchurl
- url
+
+ builtins.fetchurl
+ urlDownload the specified URL and return the path of
the downloaded file. This function is not available if
- fetchTarball
- url
+
+ fetchTarball
+ urlDownload the specified URL, unpack it and return
the path of the unpacked tree. The file must be a tape archive
@@ -346,7 +370,7 @@ stdenv.mkDerivation { … }
-
+ builtins.fetchGitargs
@@ -546,7 +570,8 @@ stdenv.mkDerivation {
- builtins.foldl’
+
+ builtins.foldl’opnullistReduce a list by applying a binary operator, from
@@ -559,7 +584,8 @@ stdenv.mkDerivation {
- builtins.functionArgs
+
+ builtins.functionArgsf
@@ -577,7 +603,8 @@ stdenv.mkDerivation {
- builtins.fromJSONe
+
+ builtins.fromJSONeConvert a JSON string to a Nix
value. For example,
@@ -592,8 +619,9 @@ builtins.fromJSON ''{"x": [1, 2, 3], "y": null}''
- builtins.genList
- generatorlength
+
+ builtins.genList
+ generatorlengthGenerate list of size
length, with each element
@@ -610,8 +638,9 @@ builtins.genList (x: x * x) 5
- builtins.getAttr
- sset
+
+ builtins.getAttr
+ ssetgetAttr returns the attribute
named s from
@@ -623,8 +652,9 @@ builtins.genList (x: x * x) 5
- builtins.getEnv
- s
+
+ builtins.getEnv
+ sgetEnv returns the value of
the environment variable s, or an empty
@@ -641,8 +671,9 @@ builtins.genList (x: x * x) 5
- builtins.hasAttr
- sset
+
+ builtins.hasAttr
+ ssethasAttr returns
true if set has an
@@ -655,8 +686,9 @@ builtins.genList (x: x * x) 5
- builtins.hashString
- types
+
+ builtins.hashString
+ typesReturn a base-16 representation of the
cryptographic hash of string s. The
@@ -667,8 +699,9 @@ builtins.genList (x: x * x) 5
- builtins.head
- list
+
+ builtins.head
+ listReturn the first element of a list; abort
evaluation if the argument isn’t a list or is an empty list. You
@@ -678,8 +711,9 @@ builtins.genList (x: x * x) 5
- import
- path
+
+ import
+ pathLoad, parse and return the Nix expression in the
file path. If path
@@ -733,8 +767,9 @@ x: x + 456
- builtins.intersectAttrs
- e1e2
+
+ builtins.intersectAttrs
+ e1e2Return a set consisting of the attributes in the
set e2 that also exist in the set
@@ -743,8 +778,9 @@ x: x + 456
- builtins.isAttrs
- e
+
+ builtins.isAttrs
+ eReturn true if
e evaluates to a set, and
@@ -753,8 +789,9 @@ x: x + 456
- builtins.isList
- e
+
+ builtins.isList
+ eReturn true if
e evaluates to a list, and
@@ -763,7 +800,7 @@ x: x + 456
- builtins.isFunction
+ builtins.isFunctioneReturn true if
@@ -773,8 +810,9 @@ x: x + 456
- builtins.isString
- e
+
+ builtins.isString
+ eReturn true if
e evaluates to a string, and
@@ -783,8 +821,9 @@ x: x + 456
- builtins.isInt
- e
+
+ builtins.isInt
+ eReturn true if
e evaluates to an int, and
@@ -793,8 +832,9 @@ x: x + 456
- builtins.isFloat
- e
+
+ builtins.isFloat
+ eReturn true if
e evaluates to a float, and
@@ -803,8 +843,9 @@ x: x + 456
- builtins.isBool
- e
+
+ builtins.isBool
+ eReturn true if
e evaluates to a bool, and
@@ -813,8 +854,9 @@ x: x + 456
- isNull
- e
+
+ isNull
+ eReturn true if
e evaluates to null,
@@ -828,8 +870,9 @@ x: x + 456
- builtins.length
- e
+
+ builtins.length
+ eReturn the length of the list
e.
@@ -837,8 +880,9 @@ x: x + 456
- builtins.lessThan
- e1e2
+
+ builtins.lessThan
+ e1e2Return true if the number
e1 is less than the number
@@ -850,8 +894,9 @@ x: x + 456
- builtins.listToAttrs
- e
+
+ builtins.listToAttrs
+ eConstruct a set from a list specifying the names
and values of each attribute. Each element of the list should be
@@ -877,8 +922,9 @@ builtins.listToAttrs
- map
- flist
+
+ map
+ flistApply the function f to
each element in the list list. For
@@ -893,14 +939,15 @@ map (x: "foo" + x) [ "bar" "bla" "abc" ]
- builtins.match
- regexstr
+
+ builtins.match
+ regexstr
- Returns a list if the extended
- POSIX regular expression regex
- matches str precisely, otherwise returns
- null. Each item in the list is a regex group.
+ Returns a list if the extended
+ POSIX regular expression regex
+ matches str precisely, otherwise returns
+ null. Each item in the list is a regex group.
builtins.match "ab" "abc"
@@ -926,11 +973,12 @@ builtins.match "[[:space:]]+([[:upper:]]+)[[:space:]]+" " FOO "
Evaluates to [ "foo" ].
-
+
- builtins.mul
- e1e2
+
+ builtins.mul
+ e1e2Return the product of the numbers
e1 and
@@ -939,8 +987,9 @@ Evaluates to [ "foo" ].
- builtins.parseDrvName
- s
+
+ builtins.parseDrvName
+ sSplit the string s into
a package name and version. The package name is everything up to
@@ -953,7 +1002,7 @@ Evaluates to [ "foo" ].
-
+ builtins.pathargs
@@ -1023,8 +1072,9 @@ Evaluates to [ "foo" ].
- builtins.pathExists
- path
+
+ builtins.pathExists
+ pathReturn true if the path
path exists, and
@@ -1047,8 +1097,9 @@ in config.someSetting
- builtins.readDir
- path
+
+ builtins.readDir
+ pathReturn the contents of the directory
path as a set mapping directory entries
@@ -1069,8 +1120,9 @@ in config.someSetting
- builtins.readFile
- path
+
+ builtins.readFile
+ pathReturn the contents of the file
path as a string.
@@ -1078,8 +1130,9 @@ in config.someSetting
- removeAttrs
- setlist
+
+ removeAttrs
+ setlistRemove the attributes listed in
list from
@@ -1094,8 +1147,9 @@ removeAttrs { x = 1; y = 2; z = 3; } [ "a" "x" "z" ]
- builtins.replaceStrings
- fromtos
+
+ builtins.replaceStrings
+ fromtosGiven string s, replace
every occurrence of the strings in from
@@ -1111,8 +1165,9 @@ builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar"
- builtins.seq
- e1e2
+
+ builtins.seq
+ e1e2Evaluate e1, then
evaluate and return e2. This ensures
@@ -1122,8 +1177,9 @@ builtins.replaceStrings ["oo" "a"] ["a" "i"] "foobar"
- builtins.sort
- comparatorlist
+
+ builtins.sort
+ comparatorlistReturn list in sorted
order. It repeatedly calls the function
@@ -1145,15 +1201,16 @@ builtins.sort builtins.lessThan [ 483 249 526 147 42 77 ]
- builtins.split
- regexstr
+
+ builtins.split
+ regexstr
- Returns a list composed of non matched strings interleaved
- with the lists of the extended
- POSIX regular expression regex matches
- of str. Each item in the lists of matched
- sequences is a regex group.
+ Returns a list composed of non matched strings interleaved
+ with the lists of the extended
+ POSIX regular expression regex matches
+ of str. Each item in the lists of matched
+ sequences is a regex group.
builtins.split "(a)b" "abc"
@@ -1179,11 +1236,12 @@ builtins.split "([[:upper:]]+)" " FOO "
Evaluates to [ " " [ "FOO" ] " " ].
-
+
- builtins.stringLength
- e
+
+ builtins.stringLength
+ eReturn the length of the string
e. If e is
@@ -1192,8 +1250,9 @@ Evaluates to [ " " [ "FOO" ] " " ].
- builtins.sub
- e1e2
+
+ builtins.sub
+ e1e2Return the difference between the numbers
e1 and
@@ -1202,9 +1261,10 @@ Evaluates to [ " " [ "FOO" ] " " ].
- builtins.substring
- startlen
- s
+
+ builtins.substring
+ startlen
+ sReturn the substring of
s from character position
@@ -1227,8 +1287,9 @@ builtins.substring 0 3 "nixos"
- builtins.tail
- list
+
+ builtins.tail
+ listReturn the second to last elements of a list;
abort evaluation if the argument isn’t a list or is an empty
@@ -1237,8 +1298,9 @@ builtins.substring 0 3 "nixos"
- throw
- s
+
+ throw
+ sThrow an error message
s. This usually aborts Nix expression
@@ -1251,9 +1313,10 @@ builtins.substring 0 3 "nixos"
- builtins.toFile
- names
+
+ builtins.toFile
+ name
+ sStore the string s in a
file in the Nix store and return its path. The file has suffix
@@ -1329,7 +1392,8 @@ in foo
- builtins.toJSONe
+
+ builtins.toJSONeReturn a string containing a JSON representation
of e. Strings, integers, floats, booleans,
@@ -1342,7 +1406,8 @@ in foo
- builtins.toPaths
+
+ builtins.toPathsConvert the string value
s into a path value. The string
@@ -1355,7 +1420,8 @@ in foo
- toStringe
+
+ toStringeConvert the expression
e to a string.
@@ -1374,7 +1440,8 @@ in foo
- builtins.toXMLe
+
+ builtins.toXMLeReturn a string containing an XML representation
of e. The main application for
@@ -1489,8 +1556,9 @@ stdenv.mkDerivation (rec {
- builtins.trace
- e1e2
+
+ builtins.trace
+ e1e2Evaluate e1 and print its
abstract syntax representation on standard error. Then return
@@ -1499,8 +1567,9 @@ stdenv.mkDerivation (rec {
- builtins.tryEval
- e
+
+ builtins.tryEval
+ eTry to evaluate e.
Return a set containing the attributes success
@@ -1513,8 +1582,9 @@ stdenv.mkDerivation (rec {
- builtins.typeOf
- e
+
+ builtins.typeOf
+ eReturn a string representing the type of the value
e, namely "int",