Skip to content

den.aspects

An attribute set of aspects. Each aspect key names an aspect; its value is an aspect set containing per-class deferred modules and optional includes and provides:

den.aspects = {
dns = {
nixos.services.resolved.enable = true;
darwin.networking.dns = [ "1.1.1.1" ];
includes = [ ./dns ];
};
};

Den auto-generates den.aspects entries from den.hosts, den.homes, and den.users. For every declared host/home/user, an aspect is created with the appropriate class configurations. You do not need to declare den.aspects manually unless adding shared aspects.

Type: attrsOf aspectsType

Namespaced aspect collections. Each key is a namespace name, each value is a full aspectsType. Populated by den.namespace or by merging upstream denful flake outputs.

den.ful.myns = {
some-aspect = { nixos.services.foo.enable = true; };
};

Type: attrsOf raw

Raw flake output for publishing namespaces. Set automatically by den.namespace; consumed by downstream flakes that import your aspects.

An aspect is an attribute set with:

KeyPurpose
<class>Config merged into hosts/homes of that class
includesList of modules or functions dispatched by context
__functorAuto-generated by parametric; drives dispatch

Functions in includes receiving { class, aspect-chain } are static — evaluated once during aspect resolution. Functions receiving context arguments ({ host }, { user }, etc.) are parametric — evaluated per context during ctxApply.

This is the place for Den built-in batteries, reusable aspects that serve as basic utilities and examples.

See Batteries Reference.

When aspects are resolved for a host, Den:

  1. Collects all aspects referenced by the host
  2. Extracts the class-specific config (e.g., nixos for NixOS hosts)
  3. Evaluates static includes with { class, aspect-chain }
  4. Builds context pairs from den.ctx
  5. Applies parametric includes via ctxApply
  6. Merges everything into the host’s evalModules call
Contribute Community Sponsor