Skip to content

Angle Brackets Syntax

Den provides a __findFile implementation that resolves <aspect/path> expressions into deep aspect lookups. This is syntactic sugar for accessing nested aspects and provides.

Set __findFile via module args:

{ den, ... }: {
_module.args.__findFile = den.lib.__findFile;
}

In any file where you want to use the angle-brackets syntax, add __findFile to the arguments attrset to bring it into that module’s lexical scope.

{ den, __findFile, ... }: {
...
}

The <name> expression resolves through these paths in order:

  1. <den/battery> — resolves to the battery config.den.batteries.battery (when the segment after den names a registered battery), e.g. <den/primary-user>.
  2. <den.x.y> — otherwise resolves to config.den.x.y (any den.* path), e.g. <den.lib.parametric>.
  3. <aspect> — resolves to config.den.aspects.aspect (when aspect exists in den.aspects).
  4. <aspect/sub> — resolves to the sub key of that aspect.
  5. <namespace/aspect> — resolves into a namespace, config.den.ful.namespace.aspect.

The / separator is translated to . in the lookup path, so <den/primary-user> and <den.primary-user> are equivalent.

# Without angle brackets
den.aspects.laptop.includes = [
den.aspects.tools.editors
den.aspects.alice.work-vpn
den.batteries.primary-user
];
# With angle brackets
den.aspects.laptop.includes = [
<tools/editors>
<alice/work-vpn>
<den/primary-user>
];

Angle brackets are optional syntactic sugar. They are useful when:

  • You have deeply nested provides and want shorter references.
  • You are working with namespaces and want concise cross-references.

They are functionally identical to direct attribute access. The choice is a matter of style.

Contribute Community Sponsor