den.lib (deprecated)
den.lib.parametric
Section titled “den.lib.parametric”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 = [ ... ]; }den.lib.parametric.atLeast
Section titled “den.lib.parametric.atLeast”Identity passthrough (warns). Previously: match when all required params are present.
den.lib.parametric.exactly
Section titled “den.lib.parametric.exactly”Identity passthrough (warns). Previously: match only when required params exactly equal provided params.
den.lib.parametric.exactly { includes = [ ({ host }: ...) ]; }den.lib.parametric.fixedTo
Section titled “den.lib.parametric.fixedTo”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; } someAspectden.lib.parametric.expands
Section titled “den.lib.parametric.expands”Merges additional attributes into the aspect’s scope handlers before dispatch. Returns a parametric wrapper and warns.
den.lib.parametric.expands { extra = true; } someAspectden.lib.canTake
Section titled “den.lib.canTake”Function argument introspection. A pure predicate (it does not warn), still used internally by the type system; prefer plain parametric functions in new code.
den.lib.canTake params fn
Section titled “den.lib.canTake params fn”Returns true if fn’s required arguments are satisfied by params (atLeast).
den.lib.canTake.atLeast params fn
Section titled “den.lib.canTake.atLeast params fn”Same as canTake.
den.lib.canTake.exactly params fn
Section titled “den.lib.canTake.exactly params fn”Returns true only if fn’s required arguments exactly match params.
den.lib.canTake.upTo params fn
Section titled “den.lib.canTake.upTo params fn”Returns true if fn is satisfied by params and at least one of params
overlaps fn’s arguments.
den.lib.take
Section titled “den.lib.take”Context-level guards. Under handler-based resolution the pipeline resolves function arguments automatically, so most of these now warn.
den.lib.take.exactly fn
Section titled “den.lib.take.exactly fn”Returns a parametric wrapper that calls fn only when the resolved context
matches fn’s declared arguments exactly (no extra context keys). Warns.
den.lib.take.atLeast fn
Section titled “den.lib.take.atLeast fn”Identity passthrough (warns). The pipeline’s deferral already provides
atLeast semantics.
den.lib.take.upTo fn
Section titled “den.lib.take.upTo fn”Identity passthrough (warns).
den.lib.take.unused
Section titled “den.lib.take.unused”_unused: used: used — ignores the first argument, returns the second. A plain
helper (does not warn).
Context shortcuts
Section titled “Context shortcuts”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, ... }: { ... }).
den.lib.perHost aspect
Section titled “den.lib.perHost aspect”Wrap aspect to require { host }.
den.lib.perUser aspect
Section titled “den.lib.perUser aspect”Wrap aspect to require { host, user }.
den.lib.perHome aspect
Section titled “den.lib.perHome aspect”Wrap aspect to require { home }.