Expand description
Clean-room Nix language evaluator.
Architecture: Nix source → rnix parser (CST) → Evaluator (values)
Parsing is delegated to the rnix crate (MIT).
Re-exports§
pub use eval::eval;pub use eval::eval_with_file;pub use value::EvalError;pub use value::Value;
Modules§
- builtins
- Core Nix builtins (90+ functions). Core Nix builtins.
- convert
- Bidirectional conversion between bytecode VM values and tree-walker values. Bidirectional conversion between bytecode VM values and tree-walker values.
- drv_
cache - Content-addressed derivation path cache (redb-backed). Content-addressed derivation path cache.
- eval
- Tree-walking evaluator using rnix’s typed AST. Tree-walking Nix evaluator using rnix’s typed AST.
- eval_
cache - Content-addressed evaluation cache (file hash + lock hash → result). Content-addressed evaluation cache.
- fetcher
- Content-addressed input fetcher for flake.lock resolved inputs. Content-addressed input fetcher for flake.lock resolved inputs.
- flake
- Re-export flake lock types from sui-compat where they canonically live.
- flake_
lock - Native flake lock management — update, check, write.
Native flake lock management — update, check, and write
flake.lock. - git
- Pure-Rust git operations via gix/gitoxide (no CLI spawning, no C deps).
Pure-Rust git helpers using
gix(gitoxide). - lazy
- Lazy evaluation primitives — making accidental eagerness impossible. Lazy evaluation primitives — making accidental eagerness impossible.
- path
- Centralized path resolution (normalize, resolve relative, import). Centralized path resolution for the Nix evaluator.
- perf
- Lightweight evaluation profiling counters.
Lightweight evaluation profiling counters.
Enabled via
SUI_EVAL_PERF=1environment variable. - pos
- Source positions for
builtins.unsafeGetAttrPos/__curPos. Source positions forbuiltins.unsafeGetAttrPos(and__curPos). - realize
- Import-from-derivation: realize a derivation output mid-eval via a binary-installed hook (the pure evaluator owns no build pipeline). Import-from-derivation (IFD): realize a derivation’s output mid-eval.
- render
- The normalized differential render (deep-forcing, error-propagating) the
sui↔sui differential + the
SUI_IRshadow-eval latch byte-compare againsteval_ir. Must stay format-locked withsui_ir::render. The tree-walker’s normalized differential render. - resolve_
env - ENV-RESOLVE M0 flag + per-source resolution-table plumbing (the
tree-walker’s consume side of the
sui-resolveside-table). ENV-RESOLVE M0 — the tree-walker’s consume side of thesui-resolveparse-time variable-resolution side-table. - trace
- Infinite recursion debugging tools (force chain, trace, depth limit, stats). Infinite recursion debugging tools for the tree-walker evaluator.
- value
- Nix value types, environments, thunks, and error types. Nix value types and environments.
Structs§
- Bytecode
Evaluator - Bytecode VM evaluator — compiles to bytecode and executes on the stack VM.
- Tree
Walk Evaluator - The default tree-walking evaluator.
Traits§
- Evaluator
- The evaluator trait — enables swapping evaluation strategies.
Functions§
- eval_
to_ string_ keyed - Convert a tree-walker
Valueto aStringKeyedValue(no interner needed).