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).

Wrap an aspect so it requires a specific set of context keys. Each returns a parametric wrapper and warns. They are now thin aliases for a plain function with the same keys — i.e. den.lib.perHost f behaves as ({ host, ... }: f { … }): the arg binds once at the emitting scope if in-ctx, fans out class-locally over that scope’s descendants otherwise, and is inert if misplaced. Prefer the plain function form, e.g. ({ host, user, ... }: { ... }).

Wrap aspect to require { host }.

Wrap aspect to require { host, user }.

Wrap aspect to require { home }.

Contribute Community Sponsor