Skip to main content

evaluate_flake

Function evaluate_flake 

Source
pub fn evaluate_flake(flake_dir: &Path) -> Result<Value, EvalError>
Expand description

Evaluate a flake directory — reads flake.nix, parses flake.lock, resolves inputs, calls outputs(inputs), and returns the merged result attrset.

This is the native implementation of builtins.getFlake for path-based references. External callers (orchestrate, CLI) can use this to evaluate a local flake without shelling out to nix eval.

This is the ROOT entrypoint: it reads flake_dir/flake.lock as the authoritative closure and evaluates from its root node. Transitive inputs are resolved against THIS lock (see [FlakeContext]), never their own.