den.ctx (Compatibility Shim)
What it does
Section titled “What it does”den.ctx was the original API for declaring aspects and binding them to entity
resolution stages. It combined aspect definitions, cross-entity providers, and
pipeline transitions in a single namespace.
The compatibility shim in modules/compat/ctx-shim.nix accepts den.ctx.*
entries and forwards them:
den.ctx.<name> = { ... } ↓den.schema.<name>.includes = [ <value with deprecation warning> ]Each forwarded value emits a lib.warn at evaluation time telling you exactly
what to change.
What replaced it
Section titled “What replaced it”The den.ctx namespace was split into three independent concerns:
Old (den.ctx) | New | Purpose |
|---|---|---|
den.ctx.<name> = { ... } | den.aspects.<name> = { ... } | Aspect definitions |
den.ctx.<name>.into.<other> | den.policies.<name> | Entity topology (fan-out, routing) |
den.ctx.<name>.provides.<other> | den.schema.<kind>.includes | Cross-entity inclusion |
| Implicit activation | den.schema.<kind>.includes = [ ... ] | Explicit activation via includes |
Example migration
Section titled “Example migration”Before:
den.ctx.host = { provides.host = { host }: den.aspects.${host.aspect}; into.user = { host }: map (user: { inherit host user; }) (lib.attrValues host.users);};After:
# Aspect definitionden.aspects.my-aspect = { host }: { nixos.services.foo.enable = true;};
# Entity topology via policyden.policies.host-to-users = { host, ... }: map (user: policy.resolve.to "user" { inherit host user; }) (lib.attrValues host.users);
# Activationden.schema.host.includes = [ den.aspects.my-aspect ];