-
-
Notifications
You must be signed in to change notification settings - Fork 8
initial context
Den uses intent contexts to determine which configuration modules to include. An intent context is an attribute set passed to parametric aspects, and the attribute names determine which functions get called.
When building an OS configuration (NixOS or Darwin), Den starts with the context { OS, host }:
-
OS- Self-reference to the aspect being applied -
host- The host configuration fromden.hosts.<system>.<name>
For users with home-manager integration on a host, the context expands to include user data:
-
HM- Reference to the user's home-manager aspect -
user- The user configuration fromhost.users.<name> -
host- The host the user belongs to
For standalone home-manager configurations (not attached to a host):
-
HM- Reference to the home aspect -
home- The home configuration fromden.homes.<system>.<name>
Den provides a special context for detecting hosts that have home-manager enabled:
-
HM-OS-HOST- Only present for hosts with HM-supported OS and at least one homeManager-class user
Working Example: See hm-enabled-host.nix for using
HM-OS-HOSTcontext to conditionally configure hosts.
You can create your own contexts for specialized dependency handling. Any attribute set can serve as a context - the key is matching the required arguments of your parametric functions.
Working Example: See parametric-with-owned.nix for advanced context manipulation with
fixedToandexpands.