Skip to content

den.lib (deprecated)

Historically wrapped an aspect to filter includes by argument compatibility. The fx pipeline now resolves parametric dispatch directly, so parametric and parametric.atLeast / parametric.exactly are identity passthroughs that emit a deprecation warning. Each call logs den.lib.parametric: … is deprecated.

# Deprecated — pass the plain attrset directly instead.
den.lib.parametric { nixos.x = 1; includes = [ ... ]; }

Identity passthrough (warns). Previously: match when all required params are present.

Identity passthrough (warns). Previously: match only when required params exactly equal provided params.

den.lib.parametric.exactly { includes = [ ({ host }: ...) ]; }

Pins context values for the aspect via scope handlers (constantHandler), so the aspect resolves as if those values were in scope. Returns a parametric wrapper and warns. Variants .exactly, .atLeast, and .upTo behave the same.

den.lib.parametric.fixedTo { host = myHost; } someAspect

Merges additional attributes into the aspect’s scope handlers before dispatch. Returns a parametric wrapper and warns.

den.lib.parametric.expands { extra = true; } someAspect

Function argument introspection. A pure predicate (it does not warn), still used internally by the type system; prefer plain parametric functions in new code.

Returns true if fn’s required arguments are satisfied by params (atLeast).

Same as canTake.

Returns true only if fn’s required arguments exactly match params.

Returns true if fn is satisfied by params and at least one of params overlaps fn’s arguments.

Context-level guards. Under handler-based resolution the pipeline resolves function arguments automatically, so most of these now warn.

Returns a parametric wrapper that calls fn only when the resolved context matches fn’s declared arguments exactly (no extra context keys). Warns.

Identity passthrough (warns). The pipeline’s deferral already provides atLeast semantics.

Identity passthrough (warns).

_unused: used: used — ignores the first argument, returns the second. A plain helper (does not warn).

Run an aspect only at a specific context level. Each returns a parametric wrapper (declaring deeper context keys as optional) that yields {} when resolved at a deeper level, and warns. Prefer a plain function with the level’s keys, e.g. ({ host, user, ... }: { ... }).

Run aspect only in { host } contexts.

Run aspect only in { host, user } contexts.

Run aspect only in { home } contexts.

Contribute Community Sponsor