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

EnvPath (Search Path)

Definition

EnvPath FilePath

Fields

FieldTypeDescription
contentsFilePathThe path string (e.g., nixpkgs)

Description

EnvPath represents paths written in angle brackets like <nixpkgs> or <nixos>. These are looked up in the Nix search path (NIX_PATH environment variable) and are distinct from literal file paths.

Nix Source ↔ AST

# Nix
<nixpkgs>

# AST
{
  "tag": "EnvPath",
  "contents": "nixpkgs"
}
# Nix
<nixos>

# AST
{
  "tag": "EnvPath",
  "contents": "nixos"
}

Nix Library Access

syntax.mkEnvPath "nixpkgs"
syntax.mkEnvPath "nixos"