Builtins

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 the Nix manualexternal link .

The impl column indicates implementation status in tvix:

  • implemented: "" (empty cell)
  • not yet implemented, but not blocked: todo
  • not yet implemented, but blocked by other prerequisites:
    • store: awaiting eval<->store api(s)
    • context: awaiting support for string contexts
nameglobalaritypureimpl
aborttrue1
addfalse2true
addErrorContextfalse?context
allfalse2true
anyfalse2true
appendContextfalse?
attrNamesfalse1true
attrValuesfalsetrue
baseNameOftrue
bitAndfalse
bitOrfalse
bitXorfalse
builtinstrue
catAttrsfalse
compareVersionsfalse
concatListsfalse
concatMapfalse
concatStringsSepfalse
currentSystemfalse
currentTimefalsefalse
deepSeqfalse
derivationtruestore
derivationStricttruestore
dirOftrue
divfalse
elemfalse
elemAtfalse
falsetrue
fetchGittruestore
fetchMercurialtruestore
fetchTarballtruestore
fetchurlfalsestore
filterfalse
filterSourcefalsestore
findFilefalsefalsetodo
foldl'false
fromJSONfalse
fromTOMLtrue
functionArgsfalse
genListfalse
genericClosurefalse
getAttrfalse
getContextfalse
getEnvfalsefalse
hasAttrfalse
hasContextfalse
hashFilefalsefalse
hashStringfalse
headfalse
importtrue
intersectAttrsfalse
isAttrsfalse
isBoolfalse
isFloatfalse
isFunctionfalse
isIntfalse
isListfalse
isNulltrue
isPathfalse
isStringfalse
langVersionfalse
lengthfalse
lessThanfalse
listToAttrsfalse
maptrue
mapAttrsfalse
matchfalse
mulfalse
nixPathfalsetodo
nixVersionfalse
nulltrue
parseDrvNamefalse
partitionfalse
pathfalsesometimesstore
pathExistsfalsefalse
placeholdertruecontext
readDirfalsefalse
readFilefalsefalse
removeAttrstrue
replaceStringsfalse
scopedImporttrue
seqfalse
sortfalse
splitfalse
splitVersionfalse
storeDirfalsestore
storePathfalsestore
stringLengthfalse
subfalse
substringfalse
tailfalse
throwtrue
toFilefalsestore
toJSONfalse
toPathfalse
toStringtrue
toXMLtrue
tracefalse
truetrue
tryEvalfalse
typeOffalse
unsafeDiscardOutputDependencyfalse
unsafeDiscardStringContextfalse
unsafeGetAttrPosfalsetodo
valueSizefalsetodo

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

nameglobalaritypureimpl
breakfalse1todo
ceilfalse1true
fetchTreetrue1todo
floorfalse1true
groupByfalse2true
traceVerbosefalse2todo
zipAttrsWithfalse2true