about summary refs log tree commit diff
path: root/tvix/eval/docs/builtins.md
blob: 27ee363a0b57289708fd0bea27d57fd3bba16b2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Nix builtins
============

Nix has a lot of built-in functions, some of which are accessible in
the global scope, and some of which are only accessible through the
global `builtins` attribute set.

This document is an attempt to track all of these builtins, but
without documenting their functionality.

See also https://nixos.org/manual/nix/stable/expressions/builtins.html

| name                          | global | arity | pure  |
|-------------------------------|--------|-------|-------|
| abort                         | true   | 1     |       |
| add                           | false  | 2     | true  |
| addErrorContext               | false  | ?     |       |
| all                           | false  | 2     | true  |
| any                           | false  | 2     | true  |
| appendContext                 | false  | ?     |       |
| attrNames                     | false  | 1     | true  |
| attrValues                    | false  |       | true  |
| baseNameOf                    | true   |       |       |
| bitAnd                        | false  |       |       |
| bitOr                         | false  |       |       |
| bitXor                        | false  |       |       |
| builtins                      | true   |       |       |
| catAttrs                      | false  |       |       |
| compareVersions               | false  |       |       |
| concatLists                   | false  |       |       |
| concatMap                     | false  |       |       |
| concatStringsSep              | false  |       |       |
| currentSystem                 | false  |       |       |
| currentTime                   | false  |       |       |
| deepSeq                       | false  |       |       |
| derivation                    | true   |       |       |
| derivationStrict              | true   |       |       |
| dirOf                         | true   |       |       |
| div                           | false  |       |       |
| elem                          | false  |       |       |
| elemAt                        | false  |       |       |
| false                         | true   |       |       |
| fetchGit                      | true   |       |       |
| fetchMercurial                | true   |       |       |
| fetchTarball                  | true   |       |       |
| fetchurl                      | false  |       |       |
| filter                        | false  |       |       |
| filterSource                  | false  |       |       |
| findFile                      | false  |       |       |
| foldl'                        | false  |       |       |
| fromJSON                      | false  |       |       |
| fromTOML                      | true   |       |       |
| functionArgs                  | false  |       |       |
| genList                       | false  |       |       |
| genericClosure                | false  |       |       |
| getAttr                       | false  |       |       |
| getContext                    | false  |       |       |
| getEnv                        | false  |       | false |
| hasAttr                       | false  |       |       |
| hasContext                    | false  |       |       |
| hashFile                      | false  |       |       |
| hashString                    | false  |       |       |
| head                          | false  |       |       |
| import                        | true   |       |       |
| intersectAttrs                | false  |       |       |
| isAttrs                       | false  |       |       |
| isBool                        | false  |       |       |
| isFloat                       | false  |       |       |
| isFunction                    | false  |       |       |
| isInt                         | false  |       |       |
| isList                        | false  |       |       |
| isNull                        | true   |       |       |
| isPath                        | false  |       |       |
| isString                      | false  |       |       |
| langVersion                   | false  |       |       |
| length                        | false  |       |       |
| lessThan                      | false  |       |       |
| listToAttrs                   | false  |       |       |
| map                           | true   |       |       |
| mapAttrs                      | false  |       |       |
| match                         | false  |       |       |
| mul                           | false  |       |       |
| nixPath                       | false  |       |       |
| nixVersion                    | false  |       |       |
| null                          | true   |       |       |
| parseDrvName                  | false  |       |       |
| partition                     | false  |       |       |
| path                          | false  |       |       |
| pathExists                    | false  |       |       |
| placeholder                   | true   |       |       |
| readDir                       | false  |       |       |
| readFile                      | false  |       |       |
| removeAttrs                   | true   |       |       |
| replaceStrings                | false  |       |       |
| scopedImport                  | true   |       |       |
| seq                           | false  |       |       |
| sort                          | false  |       |       |
| split                         | false  |       |       |
| splitVersion                  | false  |       |       |
| storeDir                      | false  |       |       |
| storePath                     | false  |       |       |
| stringLength                  | false  |       |       |
| sub                           | false  |       |       |
| substring                     | false  |       |       |
| tail                          | false  |       |       |
| throw                         | true   |       |       |
| toFile                        | false  |       |       |
| toJSON                        | false  |       |       |
| toPath                        | false  |       |       |
| toString                      | true   |       |       |
| toXML                         | false  |       |       |
| trace                         | false  |       |       |
| true                          | true   |       |       |
| tryEval                       | false  |       |       |
| typeOf                        | false  |       |       |
| unsafeDiscardOutputDependency | false  |       |       |
| unsafeDiscardStringContext    | false  |       |       |
| unsafeGetAttrPos              | false  |       |       |
| valueSize                     | false  |       |       |

## Added after C++ Nix 2.3 (without Flakes enabled)

| name          | global | arity | pure  |
|---------------|--------|-------|-------|
| break         | false  | 1     |       |
| ceil          | false  | 1     | true  |
| fetchTree     | true   | 1     |       |
| floor         | false  | 1     | true  |
| groupBy       | false  | 2     | true  |
| traceVerbose  | false  | 2     |       |
| zipAttrsWith  | false  | 2     | true  |