Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sym (Variable Reference)

Definition

Sym VarName

Fields

FieldTypeDescription
contentsVarNameThe variable name

Description

Sym represents a reference to a variable in scope. It is used for:

  • Function parameters
  • Let-bound variables
  • Inherited variables
  • Built-in identifiers (e.g., builtins, pkgs)

Nix Source ↔ AST

# Nix
x

# AST
{
  "tag": "Sym",
  "contents": "x"
}
# Nix
builtins.map

# AST
{
  "tag": "Sym",
  "contents": "builtins.map"
}

Nix Library Access

syntax.mkSym "x"
syntax.mkSym "builtins.map"