Skip to main content

plan_for_group

Function plan_for_group 

Source
pub fn plan_for_group<N: HasEntry>(
    node: &N,
    recursive: bool,
) -> Result<Option<GroupPlan>, NormalizeError>
Expand description

The plan for ONE binding group, computed on demand.

None means the group needs no normalization — no duplicate static key and no dotted path — so the caller keeps its existing construction path.

★ THIS IS THE PREFERRED ENTRY POINT. normalize walks a whole file and plans every binder in it, including the ones laziness never evaluates; measured on a real nixpkgs eval that is a ~4% wall-clock tax for work that is mostly discarded. Planning a group when it is first EVALUATED moves the cost onto the groups that actually matter, and the result is identical: a group’s plan depends only on its own entries.

§Errors

Returns the group’s NormalizeError if its bindings are a duplicate nix rejects.