Skip to content

Releases

v0.20.0 - Good Fences

Choose a tag to compare

@sini sini released this 10 Nov 23:13
12b2146

Den v0.20.0

The headline change is #694: a user's aspects stop leaking into the hosts it's on. It arrives with a migration window, so upgrading changes nothing for your systems today. Den keeps the old behaviour until 2027-01-01 and warns about every host that depends on it.

Coming from an older release? The new What's changed in Den page summarises every release since 0.1, ending with a one-jump upgrade checklist.

User aspects stay with the user (#694)

Until now, anything a user aspect wrote to nixos, darwin or os reached every host that user was on, so one user's aspect could change a shared host for everyone. From 2027-01-01, that content stays with the user. It reaches a host only through a channel that names it, or because the host accepts it.

Until then, nothing changes without telling you:

  • Transition defaults keep today's behaviour. These are user-aspects and mutual-provider on every host.
  • Each host that relies on them gets one warning, listing the content that reaches it only that way, by user and aspect.
  • Some entries need nothing. An aspect written to work on a host or a user is meant to do nothing on the host when it's placed on a user.
  • For the rest, the announcement (#750) gives the fix for each case. Usually you include the aspect on the host, use the user class for account settings, include den.batteries.mutual-provider for provides.to-hosts, or include den.batteries.user-aspects to keep today's behaviour on purpose.
  • To adopt the new behaviour now and silence the warnings:
    den.migrations.user-host-content.acknowledged = true;   # remove after 2027-01-01

Den's own templates, and the configs we tested, evaluate to the same systems as v0.19 with the transition defaults on. The one difference: an extraGroups list that v0.19 duplicated is now deduplicated. The cutover itself is tracked in #759.

New: a host chooses what it receives (#756)

These change nothing until you use them. See Receiving Content for examples.

  • den.lib.policy.include.at <entity> <aspect> names the entity a policy's content attaches to. include.atClass <class> names the class too, for an entity that has none of its own.

  • admits, on a host or on den.schema.host, decides which deliveries land:

    • deny withholds named ones;
    • default = "deny" with an allow list refuses everything else, and the error names what to add.

    Den's own channels (home-manager, hjem, maid, the user class, shells) always land.

  • policyEnforcement ("strict", "per-policy" or "lenient") and den.lib.policy.strict decide who may exclude a policy.

  • Excludes name exactly what they remove. Excluding an aspect on a host also removes the policies it carries for that host's users. Excluding a policy removes that record only, and still reaches it through when, for and strict.

Policy dispatch is more predictable (#749, #751, #752)

  • A policy reaches every level below where it's registered. Before, a { host, user } policy registered on an environment never reached that environment's users, and a host with a single user missed some policies.
  • A policy fires once per set of argument values, including when one late-bound entity resolves after another.
  • Guests (VMs) are their own hosts.
  • policy.for and policy.when keep the wrapped policy's arguments. This fixes a called without required argument 'user' crash.
  • Policy claims and trace entries are looked up, not scanned (#749). This removes two quadratic costs on large fleets.

Fixes found while testing the stack

  • A policy nested in an aspect that arrives late now fires (#754). Aspects can arrive late through provides.to-users, provides.<user>, provides.to-hosts or a policy's include. Before, such a policy was silently dropped, which also stopped den.batteries.unfree reaching the host in that case.
  • Excluding an argument-taking battery works: excludes = [ den.batteries.unfree ];, along with insecure, tty-autologin, vm-autologin and import-tree, or a single use such as (den.batteries.unfree [ "steam" ]).
  • Batteries no longer collide on their arguments, and import-tree roots no longer collide on their last directory name. Before, a second use could be silently dropped.
  • The transition warning reads cleanly (#755). It no longer lists collision validators, and it shows import-tree roots without a store hash.

Fixes reported after the first tag

  • A class module that needs a user no longer takes the rest of its aspect with it (#761). Since v0.19.0, an aspect with any class module requiring user (for example homeManager = { user, ... }: …) lost all its content on a host with no users, and applied its other content once per user on a host with several. Now only that module is applied per user, and the rest of the aspect stays on the host, once.
    • An aspect's includes, policies and provides apply once at the host, as on v0.18.
    • user ? null (optional) is applied once, without a user.
    • den.default.nixos = { user, ... }: and a class key defined more than once now work, where they errored or applied twice.
  • A host's own aspect excludes as far as the host (#762). den.aspects.<host>.excludes now also removes what the host's users include, as den.hosts.<system>.<host>.excludes and den.schema.host.excludes already did. This covers the plain and parametric forms, and a policy exclude in its includes. Its meta.handleWith keeps its own reach.
  • An exclude names the aspect written there (#762). Excluding den.aspects.tools no longer also removes an unrelated inline { name = "tools"; … } that a user includes.
  • excludes in a host's provides.<user> or provides.to-users is now an error (#762). It was silently ignored, because the provide is delivered after the user's includes are resolved. Exclude on the user, or on the host's own aspect, which now reaches its users.
  • A policy in a den.default include registers once (#765, reported by @istvnurbn in #764). Since v0.20.0, a policy record built inside a { host, user } include in den.default delivered more than once: (den.batteries.user-shell "fish") there defined users.users.<name>.shell twice, so the host didn't evaluate, and a list option got duplicate entries. Copies of one include now register once, and two different policies under one name still both apply.
  • A revisited scope with a new policy include no longer throws (#767). Since v0.20.0, a config could fail to evaluate with 'builtins.elemAt' called with index 0 on a list of size 0 in ctxSeenHandler, when a scope was resolved again and brought a policy or schema include it hadn't seen. The include is now recorded and not applied twice.
  • den.lib.schema.mkInstanceRegistry supplies lib to its modules (#768, reported by @AlexLov in #766). A module in its extraModules that took { lib, ... } was refused, because only mkInstanceType passed lib through. The registry now gets lib and the entity resolved context the same way; a caller's own specialArgs still win.
  • An optional context arg with no context takes its default (#769, reported by @vipultyagi). A class module taking an optional entity arg with no context in scope next to one that is in scope, such as homeManager = { home ? null, user ? null, ... }: on a host user, threw attribute 'home' missing once the optional one was read. The absent arg is no longer passed to the module system, so its default applies.
  • The gen and nix-effects fallbacks fetch .tar.gz (#771, reported by @Keyruu in #770). A config without a gen or nix-effects input made den fetch GitHub's .zip archive through builtins.fetchTarball, which an evaluator without a zip reader can't unpack. The pinned hashes are unchanged.
  • A host-class module taking user survives the user's acceptance (#772, reported by @minhtrancccp). Since #761, an aspect in den.default whose nixos module takes { user, ... } was lost from a host that accepts the user, in transition mode or with an explicit user-aspects. It applies again, once per user.

Also in this release

  • Schema and strictness: den follows gen-schema's options-first API, and strict mode is a property of the entity kind (#717).
  • Optional nixos-wsl input: you don't need it when WSL is unused (#703).
  • Guests and static resolves: they receive complex forwards and spawns (#743), and a static resolve of a user sets its host as the parent (#744).
  • No-flake setups: the no-flake entry evaluates without flakes (#748).
  • Exclude fixes: an exclude covers its includer's subtree (#729), and a schema-included parametric aspect can be excluded (#728).
  • New docs:
    • defining your own entity kind;
    • direct aspect nesting and the _ glob;
    • den's lineage;
    • collecting quirks across system scopes.

Known limits

  • Late policy excludes have no effect. A policy.exclude effect returned by a policy that is itself delivered by another policy's include takes effect too late and removes nothing. Write the exclude on the aspect that includes what it removes, or return it from a policy listed directly in that aspect's includes.
  • A host's provide to a user can't exclude. See #762 above. Exact support, an exclude in a provide removing what the same exclude on the user removes, needs constraints solved before content, which is planned for Den's rewrite.
  • Constructor-built records need one shared value. An exclude names one record by value. So a constructor that builds a new record on each call needs that same value in both places: bind it once, or register it under den.policies.

What's Ch...

Read more

v0.19.0

Choose a tag to compare

@sini sini released this 24 Sep 21:07
37eb88c

What's Changed

  • feat: pipe.broadcast cross-scope push + collect reads exposed by @sini in #623
  • fix: derive class-content emit ctx from authoritative scope state by @sini in #624
  • fix: preserve source entity binding in forward fallback by @ZetabS in #627
  • docs: fixed typo in custom-classes documentation by @k2on in #630
  • fix: surface spawn-projected quirk emits at the requesting scope by @sini in #625
  • fix: surface the requesting scope's own quirk emits into host-aspects spawns by @sini in #633
  • fix: fan class-module entity args over scope descendants (#629) by @sini in #634
  • fix: keep same-username homes on different hosts distinct by @nolith in #641
  • fix: four silent-drop defects in forward classes and standalone homes by @sini in #643
  • feat: add environment.shells for darwin by @phucisstupid in #648
  • fix: three silent drops in aspect-key handling (._ depth, provides mask, quirk multi-def) by @sini in #650
  • fix: keep every definition of a nested aspect key defined across files by @sini in #653
  • docs: cover undocumented public surface and fix stale API references by @sini in #659
  • docs: fix erroneous url of nix-maid by @minhtrancccp in #665
  • fix: noflake template and instructions by @crasm in #656
  • Update README.md by @vic in #673
  • fix: aspect provenance collisions and the nested _ alias (#670) by @sini in #671
  • fix: collapse agreeing definitions in the route merge (#674) by @sini in #675
  • fix: resolve identity by definition value and split the provenance field by @sini in #678
  • feat: move to gen-schema HEAD via the gen hub, and resolve host-qualified aspects by @sini in #680
  • fix: merge or refuse an entity's conflicting definitions rather than dropping one by @sini in #681
  • fix: keep unnameable context values out of scope identity by @sini in #682
  • fix: keep a provides forward marked across a re-merge by @sini in #684
  • docs: load the agent instructions and the den-debugging skill by @sini in #688
  • fix: supply nixpkgs lib as a base module argument to schema kinds by @sini in #689
  • fix: nested sub-aspects doubled when included and missed by guard hasAspect by @sini in #693
  • cleanup: remove @vic from CODEOWNERS by @sini in #697
  • fix(ci): stop same-commit events from cancelling runs by @sini in #696
  • docs: correct stale API claims, add guides and case studies, move the site onto gen's stack by @sini in #695

New Contributors

Full Changelog: v0.18.0...v0.19.0

v0.18.0

Choose a tag to compare

@vic vic released this 23 Jun 22:07
5df0987

Den v0.18 Release Notes

✨ Major Features

1. Gen-schema entity port + resolver/delivery unification (#563)

Five-part stabilization reaching 1023/1023 tests (from 825 at branch start):

  • Entity schema refactor: den.schema migrates to gen-schema's mkSchemaOption/mkSchemaEntryType. Entities own id_hash via mkInstanceType. Flat declaration forms (den.hosts.igloo = {}, den.homes."tux@igloo" = {}) coexist with legacy two-level nesting.
  • Isolation + delivered-child host: microvm guests. Kind-level isolated marker, re-instantiating payload delivery, projected hasAspect re-keyed by entity id_hash (fixes nested host false-negatives).
  • Resolver decoupling: Pure arg classifier over schema entity DAG. Removes host/user-specific machinery from fx resolver core. Fixes host-scope { user } homeManager aspects leaking to all users (#609).
  • Delivery-edge unification: Nine ad-hoc mechanisms collapse to one (S, T, P, M) edge algebra. New deliver { from; to; at ?[]; mode ? "merge" } primitive; route and provides retained as thin shims. One toposorted edge-fold per root.
  • Constraint registry unification + sibling-exclusion fixes: sibling excludes no longer leak across entities. Unified scope+ancestor constraint lookup; late-policy dispatch scopes to emitting sibling.

Breaking change: Entity-arg binding now scoped (inert if not in-context). Cross-entity delivery via provides/policy only. Documented in explanation/parametric.mdx.

2. Synthesize host identity for standalone user@host homes (#605)

Standalone home user@host now resolves host-keyed config (provides.<host>, policy.when ({ host })) without declaring the host or instantiating platform builder. Minimal { name = hostName } identity synthesized; declared host still wins.

Fixes crash in related include-return path: aspects returning include-effect lists (e.g. lib.optional cond (policy.include {...})) now normalized (lists flattened, effects pass through).

3. In-context hasAspect honors projected scope state (#602)

.hasAspect inside parametric bodies now answers projected membership ("delivered into this scope") vs structural tree. Registry query (den.hosts.….users.tux.hasAspect) stays structural. Per-scope pathSetByScope recorded; zero extra pipeline runs.

🐛 Major Fixes

Resolver & delivery pipeline

  • Sibling policy.when guard dedup collision (#603): Guards compile to anonymous aspects; dedup now indices synthetic names and chains payloads, preventing second guard's content vanishing.
  • Spawn subtree routes (#603): Parent pipeline routes now apply to spawned resolution; user-scope route no longer skipped in spawn re-entry.
  • Multi-def forwarded identity (#603): Multi-def namespace children now tagged with __provider, fixing double-emission from multi-path inclusion.
  • Guarded route crashes (#600): intoPath alias honored; guarded empty-path routes now skip cleanly with optionalAttrs (not mkIf).
  • Positional context functions in includes (#578): ctx: ... functions (empty args) now routed to parametric compile and called with full scope context, not silently dropped.

Forward routing & class merging

  • Forwarded content overwritten across scopes (#583): Root content in complex forwards no longer filtered to @default-only when not an entity-owned class. Fixes cross-scope aggregation (e.g. atuin flags merging).
  • Route wrapping merge semantics (#574): Multiple aspects defining same flake class no longer clobber. Routes toposorted (producers before consumers); mergeableType deep-merges instead of shallow //.
  • Order simple routes before forwards (#584): Routes applied in correct order; custom forwards consume class content correctly.

Config & module handling

  • Don't force aspect content during key classification (#580): Lazy instantiation preserved in compile-static; no forced evaluation during structural key walk.
  • Resolve positional functions with scope context (#578): Direct lambda detection + ctxFromHandlers call instead of fx.bind.fn.
  • Null coercion in warning messages (#576): Explicit if check replaces or; no more cannot coerce null on multi-system homes with null system.

Entity & output handling

  • Disambiguate multi-system homes (#565): Same user on multiple systems auto-qualified @system (homeConfigurations."ben@x86_64-linux" / homeConfigurations."ben@aarch64-darwin"). Single-system homes keep plain name.
  • Correct flake output include schema kind (#587): Example corrected to flake-system (not non-existent flake-packages).
  • Remove __denTest hack (#571): Test harness cleanup.
  • Missing host class in batteries (#606): host ? class check prevents unfree battery crash when host lacks class.

Schema & validation

  • Flattening default den.schema (#616): Fixes Lix runtime (other nix runtimes) unable to merge multiple attrs same name in different brackets.

🎨 Refactors & Chores

  • Extract diagram library to sini/den-diagram (#564): nix/lib/diag/ → den-diagram repo. Den keeps only capture.nix (fx tracing). Templates (diagram-demo, fleet-demo) use two-step pattern. Den CI has zero den-diagram dependency.
  • Organize tests: public-api/internal-api/deadbugs (#592): Test suite restructured; CI test org documented.
  • Backport aspect-pipeline fixes (#589): Cherry-picks + one net-new (namespace root _ bundle). Namespace-root _ exposes container-level aspects (flat map, no recursion).
  • Performance: break closure chains and lazy instantiation (#579): Backport; reduced evaluation overhead.
  • CI: bump nix-effects to den branch (#529): Dependency update.

📖 Documentation

  • Remove deprecated link (#612): Archived repository pattern removed.
  • Update links & README (#595, #594): Examples simplified, links corrected.
  • Update docs from source (#593): Docs refreshed.
  • Fix typos (#597).
  • GH-pages robustness (#591): Artifact listing paginates; no longer caps at 30 (silent truncation).

✅ CI & Testing

  • Live label queries, real allow-ci gating (#607): Label checks now query API (see re-run labels); ci-deep/flake-check actually gated; main builds never cancelled; non-draft skip cleanly on docs-only PRs; approved reviews only re-trigger CI.

What's Changed

  • fix: disambiguate multi-system homes targeting same homeConfigurations output by @sini in #565
  • fix: remove __denTest hack by @vic in #571
  • ci: bump nix-effects to den branch by @vic in #529
  • fix: route wrapping merge semantics and forward ordering by @sini in #574
  • fix: null coercion in disambiguate warning message by @sini in #576
  • fix: don't force aspect content during key classification (#580) by @sini in #581
  • perf: break closure chains and lazy instantiation backport by @sini in #579
  • fix: resolve positional functions in includes with scope context by @sini in #578
  • fix: forwarded content overwritten across scopes (#583) by @sini in #585
  • fix: correct flake output include to flake-system schema kind by @sini in #587
  • fix: backport aspect-pipeline fixes from entity-gen-schema-port by @sini in #589
  • fix: order simple routes before forwards that consume their class by @sini in #584
  • fix: gh-pages dont fail if no cached versioned docs exist by @vic in #591
  • improve: organize tests public-api/internal-api/deadbugs by @vic in #592
  • docs: update docs from source by @vic in #593
  • docs: update README remove extensive code examples by @vic in #594
  • docs: update links by @vic in #595
  • refactor: Extract diagram library to sini/den-diagram by @sini in #564
  • docs: fix some typos by @quokkbit in #597
  • fix: guarded empty-path route skips cleanly; honor intoPath alias by @sini in #600
  • feat: in-context hasAspect honors projected (delivered) scope state by @sini in #602
  • fix: sibling policy.when guard dedup collision; spawn subtree routes; multi-def forwarded identity by @sini in #603
  • fix: move deadbug to proper location by @vic in #604
  • feat: synthesize host identity for standalone user@host homes by @sini in #605
  • fix: missing host class in batteries by @KP64 in #606
  • fix(ci): live label queries, real allow-ci gating, dead triggers by @sini in #607
  • fix(docs): Remove deprecated link by @Adda0 in #612
  • feat: gen-schema entity port + resolver decoupling + delivery-edge unification by @sini in #563
  • fix: flattening default den.schema by @fmway in #616

New Contributors

  • @quokkbit made their first contribution in #597
  • @KP64 made their first contribution in #606
  • @fmway made their first contribution in #616

Full Changelog: v0.17.0...v0.18.0

v0.17.0

Choose a tag to compare

@vic vic released this 21 May 15:47
8f1a594

Den v0.17.0

Highlights

Den Effectful Core

This release introduced a new effect-based core. Benchmarks measured it being 5x faster than our old recursive manual-context-passing imperative core. Thanks to @sini for leading this effort and shipping it into main.

Note

There's nothing you have to change on your code. Den using effects is only an implementation detail, one that will allows have much better deduplication and other amazing features soon(tm).


What's Changed

  • refactor: den-fx by @sini in #462
  • feat: default to ci-fast by @sini in #465
  • fix: handle mixed function+attrset defs at provides sub-aspects by @sini in #464
  • fix: preserve unresolvable includes in applyDeep by @sini in #463
  • feat: host-aspects battery for projecting host homeManager to users by @sini in #466
  • fix: resolve host-aspects for homeManager class only by @sini in #467
  • fix: module-level dedup for host-aspects overlap support by @sini in #468
  • improve(ci): Run ci fast as first check on PRs by @vic in #472
  • feat: allow host-aspects to work with other user classes by @vic in #470
  • fix: ci.bash only show success if pass == total by @vic in #471
  • feat: fx effects pipeline — replace legacy resolver by @sini in #475
  • fix: unfree provider for non-module-system user classes by @sini in #495
  • fix: insecure provider for non-module-system user classes by @sini in #497
  • fix: updating the new templates to target the same systemstate as existing templates by @Dendronite in #493
  • docs: update references to vic with denful by @theutz in #494
  • fix: nested classification, hm-host bridge, bare aspect access by @sini in #501
  • fix: policy.for accepts list of entities and hardens id_hash matching by @sini in #499
  • feat: add pipe.as stage for cross-quirk adaptation by @sini in #503
  • refactor: Move all batteries to den.batteries make den.provides and den._ aliases. by @vic in #504
  • fix: parametric functions at direct freeform children leak through providerType.merge by @sini in #505
  • fix: forward provides children onto aspect root by @sini in #506
  • fix: stable identity for bracket-resolved bare attrsets by @sini in #507
  • docs: fix some provides → batteries issues by @theutz in #508
  • fix: guard home.class access in battery homeAspect functions by @sini in #510
  • fix: import-tree class resolution and _ alias on batteries by @sini in #512
  • fix: silence recurring 'drupol' error by @sini in #513
  • fix: load versions from same server by @vic in #515
  • fix: move links from oeiuwq.com to denful.dev by @vic in #516
  • feat: vm-autologin battery by @theutz in #520
  • docs: fix links for batteries by @theutz in #518
  • fix: nested aspect key merge and includes scoping by @sini in #521
  • fix: list-merge includes/excludes in content wrapper merge by @sini in #524
  • feat: CLAUDE.md project guide and den-debugging skill by @sini in #523
  • feat: fleet-demo user registry, diagram rendering, and theme fixes by @sini in #526
  • fix: nested includes scoping and content wrapper callability by @sini in #527
  • feat: auto-label allow-ci for collaborators and add CODEOWNERS by @sini in #531
  • fix: auto-allow-ci permissions and trigger by @sini in #532
  • fix: user-scope detection for home-env batteries and diagram null guard by @sini in #533
  • fix: policy.when with hasAspect no longer cycles, policy.for accepts effect descriptors by @sini in #530
  • fix: route ensureEntry emitted function instead of attrset by @sini in #534
  • feat: ._ shorthand to include all child aspects by @sini in #536
  • fix: deferred conditional guards drain at correct scope level (#540) by @sini in #541
  • feat: scoped-import-tree example by @vic in #544
  • fix: excludes work on nested keys without _ prefix by @sini in #542
  • feat: built-in flake-parts entity kind by @sini in #543
  • feat: extend ._ shorthand to nested aspects by @sini in #546
  • feat: forward provides children onto nested aspects by @sini in #547
  • docs: add missing "provides" to aspect by @JeppeX in #550
  • docs: fix expired check by @vic in #554
  • docs: dont download expired doc archives by @vic in #555
  • fix: obviously, im just a human by @vic in #556
  • fix: use node latest on docs actions by @vic in #557
  • fix(ci): I had an amazing idea, what if we just like, use Nix instead of whatever node=latest means by @vic in #558
  • fix: inline permission check in allow-ci job by @sini in #560
  • fix: hm-host crash with standalone homes + homeManager forwarding by @sini in #559

New Contributors

Full Changelog: v0.16.0...v0.17.0

v0.16.0 - iDENtity

Choose a tag to compare

@vic vic released this 15 Apr 04:07
927f4d8

IDENtity is brought to you by @sini

IDENtity is the codename json was going to use for his own Den if he was not to take it over.


With this release let me also introduce two new maintainers, people who have been committed to Den

  • making sustained and high quality improvements, and showing willingness to keep doing so:

Welcome @sini and @DylanRJohnston.


Breaking changes:

  • Now entity.aspect is a proper aspect reference, not a name.
    If you have any custom forwarding classes or places that interpolated into den.aspects from entities, you now need to use entity.aspect directly. Migration path: #434

What's Changed

  • feat(core): add fixedTo.{atLeast,exactly,upTo} by @DylanRJohnston in #340
  • docs: add source links to examples by @theutz in #391
  • docs: import astro component into mdx by @theutz in #392
  • docs: actually rename to .mdx by @theutz in #393
  • fix: Revert "docs: add source links to examples (#391)" by @theutz in #394
  • feat: per-aspect adapter accumulation in resolve by @sini in #397
  • feat: preserve aspect identity and adapter through functor evaluation by @sini in #398
  • feat: structural provider provenance via meta.provider by @sini in #399
  • fix: strip _ aliases from external denful to prevent include duplication by @sini in #402
  • cleanup: give a name to our default composite adapter. by @vic in #403
  • feat: Add adapters.traceName and re-use at tests by @vic in #404
  • feat: forward and output resolution respects meta.adapter by @sini in #405
  • feat: adapters.trace = (filterIncludes traceNames) by @vic in #407
  • feat: tombstones, identity paths, and substitution in filterIncludes by @sini in #409
  • fix: perHost/perUser/perHome preserve aspect identity by @sini in #410
  • fix: excludeAspect cascades to provider sub-aspects by @sini in #411
  • improve(ci): rename tags to allow-ci and allow-bench by @vic in #418
  • fix: provider sub-aspect functions receive parametric context by @sini in #419
  • feat: tombstones record excludedBy for provenance tracking by @sini in #420
  • fix: rename excludedBy to excludedFrom on tombstones by @sini in #421
  • feat(ci): Add bogus action for quick drity tests by @vic in #422
  • feat(ci): Make denTest re-usable between CI and bogus templates by @vic in #424
  • fix: applyDeep skips static subs that don't consume parametric ctx by @sini in #426
  • docs: all contributions welcome by @theutz in #427
  • docs: add "Aspect Fixed Point" section by @drupol in #430
  • fix(core): make entity.aspect be real aspect reference not an string by @vic in #433
  • fix(ci): test using just ci like developers do by @vic in #435
  • fix(ci): Fix failing test by @vic in #436
  • fix: don't coerce factory-function aspects by @sini in #437
  • feat: add insecure battery by @drupol in #438
  • fix: parametric - preserve meta on materialized parametric results by @sini in #440
  • fix: propagate context through named parametric includes by @sini in #444
  • feat(repo): Add just repl that adds den and denTest into repl by @vic in #445
  • feat(core): add den.lib.strict for disabling freeform types by @DylanRJohnston in #428
  • feat: entity.hasAspect <ref> query method on context entities by @sini in #439
  • feat: adapterOwner tracking in filterIncludes + collectSelfPath helper by @sini in #451
  • fix: make home hostName nullable for standalone homes by @sini in #452

New Contributors

  • @sini made their first contribution in #397

Full Changelog: v0.15.0...v0.16.0

v0.15.0

Choose a tag to compare

@vic vic released this 07 Apr 09:15

Den v0.15.0

More human than ever.

This release main feature is more humans! Not only the user base seems to be growing, our matrix channel is very active, and we also having more questions at Zulip, but now.. Den has new maintainers <3. People that are actively using Den for themselves, frequent code contributors, actively participating at our different community channels and well experienced with Nix. I'm really really grateful for their willingness to help me and all other people at making Den work for all of us. Please welcome them: @HeitorAugustoLN, @Gwenodai, @theutz. Honorary mention to @drupol who has always been influential to Den design, as well as pushing its limits and promoting it.

Breaking changes

None that I can remember. We have made refactors and cleanup rounds at internal APIs but nothing user-facing have changed.

Den flake outputs and flake-parts forwards example.

Den aspects can directly contribute to flake outputs like packages, checks, and other per-system outputs. We also have a new template example showcasing third-party flake-parts modules being used from aspects, like writing tests for your aspec

Better cross-flake namespace

Thanks to work being done by @DylanRJohnston we now have a cleaner namespace.nix, previously I had some horrible hacks trying to make aspects correctly pass over the flake frontier. As part of that work we also have a new takes.upTo combinator that hopefully be the default combinator in the future instead of take.atLeast, the reason is upTo does not need functions to have { ... }.

Aspect introspection and adapted class resolution.

We are now starting to make our own custom optimizations to the aspect types and resolution that we initially inherited from flake-aspects. We now have aspect.meta initially inspired by @drupol infra usage, this and our new resolve.withAdapter will hopefully enable other neat features by @sini later.

What's Changed

  • fix: nh invocation for standalone homes by @theutz in #347
  • feat(class): Classes for flake exposed system outputs by @vic in #346
  • improve(core): Split outputs.nix into modules by @vic in #350
  • feat(template): forward classes for 3rd-party flake-parts modules by @vic in #351
  • feat(batteries): mutual-provider allows user-to-users provides by @vic in #354
  • feat(ctx): Aspect contributions can access source and target contexts by @vic in #356
  • cleanup(repo): Remove unused code by @vic in #357
  • Fix HTML tags in README sponsorship section by @drupol in #358
  • fix(namespaces): fix missing reflection information on imported providers from a namespace by @DylanRJohnston in #353
  • fix(core): Add defaultText to some types having default values by @vic in #361
  • docs: add Flake Parts Modules to documentation sidebar by @theutz in #366
  • fix: don't make perSystemFwd a function by @theutz in #370
  • docs: comment in flake-parts-module template about systems by @theutz in #374
  • feat(ctx): Allow .into transformations be merged from definitions by @vic in #362
  • test: check that devShell is properly created by @theutz in #375
  • fix(batteries): Make wsl.enable = true for wsl hosts. by @cfrenette in #379
  • fix(bug): inputs' on namespaced aspect by @vic in #377
  • fix: correctly forward user class using fixedTo by @HeitorAugustoLN in #380
  • fix(class): class-based parametric include coverage by @HeitorAugustoLN in #381
  • feat(core): Merging take.upTo from #340 by @vic in #384
  • cleanup(core): aspect types by @vic in #385
  • fix(docs): Flake-parts compatible output by @vic in #387
  • feat(core): aspect.meta allow attaching freeform attributes to aspects by @vic in #376
  • feat(core): resolve.withAdapter to collect custom results from resolve or change resolution. by @vic in #389
  • docs: add section about Aspects custom modules by @drupol in #388

New Contributors

Full Changelog: v0.14.0...v0.15.0

Thanks to everyone that has been using Den, reporting issues, participating at the different channels, contributing docs and code. Den is growing thanks to you :)

v0.14.0

Choose a tag to compare

@vic vic released this 30 Mar 00:30

Den v0.14.0

Den now standing on its own.

Highlights

Den is now a zero dependencies library

Migration path: #335. Den no longer depends on flake-aspects, so you can remove that input from your projects.

Versioned documentation

Each release has its own documentation snapshot accessible at https://den.oeiuwq.com/<tag>, including the
latest tag. Note that they are snapshots of the full documentation site at that release point, so the navbar is what it was at that version.

Forward class intoPath can access module args

See the example by @Damnjelly at #342

Den standalone: templates/nvf-standalone

This example is about using Den aspects to configure things without NixOS / nix-Darwin OS pipeline.

What's Changed

  • feat(ci): Add benchmark to PRs by @vic in #316
  • feat(homes): Support standalone HM without existing host by @vic in #318
  • feat(core): better error message on non-mergable flake outputs by @vic in #319
  • feat(homes): Support home context on den._.mutual-provider by @vic in #320
  • fix(ci): benchmark compare head against base by @vic in #321
  • docs: host-specific standalone homes by @musjj in #323
  • feat(template): NVF Standalone showing Den custom confs by @vic in #324
  • fix(class): Test top-level forward allows multiple aspects by @vic in #325
  • docs: fix broken link to nvf-standalone tutorial, typos by @kriswilk in #332
  • fix(template): update default template to use mutual-providers by @vic in #337
  • Revert "fix(template): update default template to use mutual-providers" by @vic in #338
  • fix(template): update default template to use mutual-providers by @vic in #339
  • improve(core): Remove flake-aspects dependency and code cleanup. by @vic in #335
  • Fix typo in schema.mdx from 'hardedned' to 'hardened' by @drupol in #343
  • feat(core): support functionArgs in IntoPath by @Damnjelly in #342

New Contributors

Full Changelog: v0.13.0...v0.14.0

v0.13.0

Choose a tag to compare

@vic vic released this 19 Mar 23:42

Den v0.13.0

More Elven Shamanic Nix now with less Bifurcated Polynomial Applicatives, much better for health!.

What's Changed

  • feat(batteries): Opt-in den._.bidirectional by @vic in #272
  • Add hjem to noflake example by @vic in #275
  • feat(batteries): mutual provider can configure generic users and hosts by @vic in #283
  • feat(core): Add host fixed-point in user schema. by @vic in #284
  • feat(batteries): allow mutual-provider pass ctx to generic aspect by @vic in #285
  • feat(lib): den.lib.perHost and den.lib.perUser by @vic in #288
  • improve(lib): split lib.nix into files by @vic in #290
  • docs: clarify how to enable angle-brackets in a file by @crasm in #291
  • fix(ctx): should not use hm from host when no-bidir enabled. by @vic in #293
  • doc: expand on docs contribution instructions by @crasm in #295
  • fix(batteries): den._.bidirectional uses fixedTo to include from host. by @vic in #298
  • feat(repo): Add devShell for tooling by @vic in #299
  • docs: remove absolute size from main den logo by @crasm in #301
  • docs: fix console command style in contributing.md by @crasm in #302
  • feat(lib): add den.lib.perHome and add documentation for context shortcuts by @HeitorAugustoLN in #303
  • fix(ci): Test using nh apps for minimal and noflake. by @vic in #305
  • feat(homes): OS bound standalone HM by @vic in #306
  • feat(class): Allow test config values on forward classes. by @vic in #307
  • feat(batteries): remove bidirectional by @vic in #308
  • feat(class): Allow top-level forwarded-alias classes by @vic in #309
  • fix(bug): nested plain-attrs aspects are parametric by @vic in #312

New Contributors

Full Changelog: v0.12.0...v0.13.0


Den v0.13 Release Notes

This release focuses on context-pipeline behavior clarity, class forwarding, and API ergonomics. It also removes the old bidirectional behaviour that was causing duplicate-values in favor of explicit mutual routing.

Den v0.13 depends on flake-aspects v0.7.0, no changes to flake-aspects were needed.

Highlights

  1. Mutual host/user routing replaces bidirectional battery
  • den._.bidirectional was first extracted from Den core into a battery and then removed.
  • den._.mutual-provider is the supported mechanism for Host providing home-environments to all users.
  • New explicit routing conventions:
    • host -> users: den.aspects.<host>.provides.to-users.*
    • user -> hosts: den.aspects.<user>.provides.to-hosts.*
    • specific peer routing still supported via den.aspects.<user>.provides.<host> or den.aspects.<host>.provides.<user>
  1. Forwarding classes now support top-level alias forwarding
  • den._.forward now supports intoPath = [ ] for root forwarding.
  • Guarded root forwarding and adapted args are supported for alias-style classes.
  • Added Examples for for guarded forwards with config-sensitive conditions like platform-specific hm classes.
  1. Parametric behavior fix for nested plain-attrs includes
  • Nested includes are treated correctly as parametric when function args are declared.
  1. New context helpers in den.lib
  • den.lib.perHost
  • den.lib.perUser
  • den.lib.perHome
  • These provide explicit context-scoped include intent and reduce usage of den.lib.take.exactly({host,user}) patterns in code.
  • They work with plain attrs or ctx-taking functions.
  1. Better den.lib and framework module organization
  • Core lib split into nix/lib/* modules.
  • default.nix and flake.nix are basically the same.

Migration Notes

1) Replace bidirectional patterns

Migration path

Until v0.12.0 Den had built-in Bidirectionality in its core.

What that meant was that Host aspects could contribute
home classes like homeManager to all its users. However
this was also the source of many duplicate reports, becuse
the Host aspect was being activated more than once: when the host was reading its own config and then later for each user context {host,user}.

We also had a "routing example" that @musjj then moved to what is now den.provides.mutual-provider #236, that contribution made us wonder if the built-in bidirectionality could be extracted from core #273 (we did) and then further conversations led to actually removing it #300 after realizing it was more complicated than necessary.

2) Forward alias classes can target class root

Previsouly or forward battery was not able to use intoPath = [] (forward into top-level target module).

Now it is possible, enabling other patterns like classes
that guard on reading from config values or things like pkgs platform:

tests

den._.forward {
  each = [ "Linux" "Darwin" ];
  fromClass = p: "hm${p}";
  intoClass = _: "homeManager";
  intoPath = _: [ ];
  fromAspect = _: lib.head aspect-chain;
  guard = { pkgs, ... }: p: lib.mkIf pkgs.stdenv."is${p}";
  adaptArgs = { config, ... }: { osConfig = config; };
}

3) Use explicit helpers for context intent

Prefer:

perHost ({ host }: { ... })
perUser ({ host, user }: { ... })
perHome ({ home }: { ... })

Over generic den.lib.take.exactly forms when intent is narrow. These forms document better the code intention. All these three work with plain attrs or functions.

4) Standalone homes bound to existing host/user gain automatic os args

Homes named like "user@host" now behaves consistently with hosted HM flows. For example, having:

den.homes.x86_64-linux."tux@igloo" = {};
den.hosts.x86_64-linux.igloo.users.tux = {};

Will

  • Correctly set <home>.userName so that batteries like define-user work.
  • Automatically bind the standalone HM instance to the OS host configuration.

This means that by declaring tux@igloo you can quickly rebuild your home
environment without rebuilding the whole igloo OS.

5) Extended schema modules for users and homes.

User schema modules an also access their host:

den.schema.user = { host, user, lib, ... }: {
  options.foo = lib.mkOption { };
};

Also standalone HM bound to an "user@host" pair give you access to home.user and home.host meaning the home object is bound to those.

User can access the host it was difined-in, via user.host, possibly rendering {host,user} into only {user} in the future -not sure-.

CI/Test and Tooling Changes

  • Added CI/workflow. update latest tag upon release, docs/test workflow changes, semantic PR updates.
  • Added shell.nix and exported devShells from flake output for contributors.

Docs and Naming Updates

  • New docs page for mutual routing: guides/mutual.
  • Custom classes and batteries docs updated to emphasize forward/mutual patterns.
  • Release/versioning docs linked from README.

Recommended Upgrade Checklist

  1. Remove any den._.bidirectional usage.
  2. Enable mutual routing explicitly with den.ctx.user.includes = [ den._.mutual-provider ]; where needed.
  3. Move host->user routing to <host>.provides.to-users and user->host routing to <user>.provides.to-hosts.
  4. Replace den.lib.take.atLeast/exactly includes with perHost/perUser/perHome where appropriate.

v0.12.0

Choose a tag to compare

@vic vic released this 13 Mar 01:38

Den v0.12.0. aka. All Things Must Pass

Where All Things = contexts, aspects and schemas that are now part of custom namespaces and can be passed around between flakes.

This release was about stabilization and performance, moving towards a more stable Den that can actually be used for sharing dendritic aspects across projects.

This paves the road for Den social goals and in particular to enable what is needed for github:vic/denful project in coming weeks.

NOTE [email protected] requires [email protected]

What's Changed

All aspects are now parametric {} by default.

This is huge QOL improvement for Den users, previously an aspect foo = { includes = [ x y ]; } was simply an attribute set that knew nothing about propagating context, for that we had to use foo = parametric { ... } so that included aspects were given the correct context.
From now on, all aspects that don't have an explicit functor set by people, are parametric {} by default.

den.base is now den.schema.

See #235

Templates now expose nh-based apps for building hosts/homes.

PR #233

Thanks to Dendritic, you can just copy modules/nh.nix module from them into your projects and it should just work.

New batteries

den._.hostname -- sets the hostName.
den._.mutual-provider -- for one-to-one mutual config contribution between host and user. See the documentation for more on these.

MicroVM template

Our new MicroVM template showcases Den extensibility, custom extensions to den.schema and den.ctx to enable microvm guests nested in microvm hosts.

New Guides: From Zero To Den and From Flake to Den

Available at https://den.oeiuwq.com/guides/from-zero-to-den .

Small Performance Improvements

We had a discussion about Den evaluation time #249, up until now we had done absolutely nothing about performance. As good (lazy) engineer I've delayed thinking about performance until it is actually measurable and actionable.

So I used hyperfine to measure some changes on a couple of places from flake-aspects resolve and Den where I believe we could have improvements. No profiling yet specific functions or zones to see what needs to be changed, I just went to modify what I believed from the top of my head to be quick fixes. I used our own test suite to benchmark changes:

Run comparission 20 runs (10 warmup) of all our CI tests between perf branch and main before it.

perf is: den@dd8fac7355be4cfe7a143bce45cbba3d786d8be1 with flake-aspects@81a51a8997abe392b9d0794424a4823adc9bd3af
main is: den@69682fffa09d57fb8a8dbf367252dbedca023207 with flake-aspects@778d8d7c1352c3b173cdcb9fd0f65acbaf4744a6

hyperfine -m 20 -w 10  -n perf "cd perf && just ci" -n main "cd main && just ci"
Benchmark 1: perf
  Time (mean ± σ):     25.840 s ±  0.931 s    [User: 24.157 s, System: 0.670 s]
  Range (min … max):   24.236 s … 27.626 s    20 runs

Benchmark 2: main
  Time (mean ± σ):     39.205 s ±  2.053 s    [User: 37.377 s, System: 0.711 s]
  Range (min … max):   36.156 s … 43.566 s    20 runs

Summary
  perf ran
    1.52 ± 0.10 times faster than main

Benchmarks are always to be taken with a graint of salt, because specific hardware, and we are talking about Nix (IO intensive) and not the fastest interpreter, I'm using community nix btw. I'm not as focused in lowering these numbers unless we can get some help from people who are actually performance engineers. I'm not.

And this benchmark is not that accurate because perf had additional tests than old main .

Anyways a bit of speed is never bad.

hjem,maid,home-manager have same den.ctx behaviour

Unified how hm-user, hjem-user and maid-user contexts work. This also fixed #254 where den.ctx.hm-user was never being applied. We now have test ensuring that this works also for den.ctx.hjem-user and other home envs. See hjem.nix and others, they are now really simple, people can create their own home environments using den.lib.home-env to integrate other nix libs.

Fixed importing parametric aspects across flakes

This was previously a big limitation that was preventing us to share parametric aspects. We were able to share static ones, but Den is about parametric, so this was really important specially for the Denful project to start. See #261 and #259

"From Zero To Den" Fixes

@ulfbayte helped us by following the Zero To Den guide and actually executing each command there and fixing inaccuracies introduced by me while writing and not running stuff :) Thanks to that the guide will be much better for people new to Nix and Den.


Merged Pull-Requests

  • host/home apps at flakes/noflake for building with nh by @vic in #233
  • rename den.base to den.schema to clarify intention by @vic in #234
  • improve(ci): Semantic PR checks by @vic in #237
  • feat(battery): New den._.hostname and .. by @musjj in #236
  • feat(template): MicroVM example integration by @vic in #240
  • fix(battery): den._.hostname strictness by @vic in #244
  • feat(docs): New guides from Zero to Den and From Flake to Den by @vic in #247
  • feat(ctx): Allow .into to be a function to attrs by @vic in #251
  • perf(core): Hyperfine benchmark and perf improvements by @vic in #255
  • refactor(homes): Make hm,hjem,maid have the same behaviour. by @vic in #257
  • fix(homes): ctx.hm-user owned config was not being included. by @vic in #258
  • fix(namespaces): test that deeply nested parametric aspects work across flakes by @vic in #259
  • feat(ctx): Allow transformations into nested contexts by @vic in #260
  • Update home-manager command to specify master branch by @ulfbayte in #264
  • feat(core): Use a parametric default functor by @vic in #243
  • feat(namespaces): Allow sharing custom ctx and schemas on namespaces by @vic in #265
  • fix(namespaces): Parametric aspect from imported namespace by @vic in #266
  • fix(docs): Fix tutorial steps on failure by @ulfbayte in #268
  • feat(ci): Add Docs build at CI by @vic in #270

New Contributors

Full Changelog: v0.11.0...v0.12.0

v0.11.0

Choose a tag to compare

@vic vic released this 06 Mar 01:18

Here's Den v0.11.0. This release is mostly about improvements to forwarding classes, multi home-environment support and bug fixes.

Improvements to forwarding classes and their documentation

Many people started using forwarding classes, and came up with great ideas that either became examples in our documentation or built-in batteries like our os class (which forwards to both nixos and darwin).

People using this uncovered some bugs we fixed in this release. As always I'm really thankful to people using Den and reporting issues, because that's the only way I can notice something went wrong.

den.default is a real aspect (again)

But now den.ctx.default = den.default. This is because using lib.mkAliasOption was producing wrong locations. The location is always reported as a file in Den source code and not the real location where people defined settings. The same problem happens with ._. alias for .provides. from flake-aspects, however we cannot remove that alias. Bug report here: https://discourse.nixos.org/t/lib-mkalias-renamedoptionmodule-doesnt-preserve-location-of-option-definition/75879

den.lib and /default.nix

Improved usability of Den as a library, our default.nix exposes den.lib and a nixModule that can be included in any module system (be it flake-parts, falake, lib.evalModules, etc).

Our Den library includes den.ctx and den.aspects but without any NixOS / Homes specifics, allowing people to use Den configuration model (context-driven + aspects) for other Nix domains (like cloud infra).

We have tests for this at den-as-library.nix CI test.

This den.lib feature also helped us with a very weird bug #216 by not having anything of the NixOS/Homes stuff normal Den framework does.

Made all batteries use take.exactly

Batteries are also examples, so it is important for them to be as correct as possible. Just in case people copy from them, we now make them use exactly matching on context.

Enabling home-manager or other home-envs.

Den has always been feature opt-in, the reason is not all people have the same needs and also because not having all features enabled at the same time helps with hunting bugs.

Previously, our home-manager integration was enabled via an aspect den.provides.home-manager. Which many people used to include in den.default.includes = [ den._.home-manager ]. We are now trying to move away from den.default as much as we can at least in core. den.default is useful and will not be removed, but since we introduced den.ctx we have better ways to include re-usable aspects.

We also have support for other home-environments, hjem and nix-maid, because of this, a single user can now choose to use any combination of home-manager and others, or none (simply using the user forwarded class). Because we now many home environments, none of them is preferred by Den. And, it is a user concern which of them each user chooses to have.

home-manager, hjem, and nix-maid work the same in Den, they use forwarding classes and are enabled when host.hjem.enable = true (or equivalent). By default this .enable value is: "has any of my users a hjem in its classes?", because the context types for each type of home den.ctx.hjem-host only activate when at least one user has requested hjem.

So now instead of using den.provides.home-manager, which home environments are active is a responsability of each user.

den.hosts.x86_64-linux.igloo.users.tux.classes = [ "homeManager" ];

However this can get repetitive when having multiple hosts or users, so you can use the den.ctx.user base schema to specify in YOUR configuration that homeManager is preferred.

den.base.user.classes = lib.mkDefault [ "homeManager" ]

The old den.provides.home-manager aspect does nothing, it raises an error telling you to now specify user.classes.

We now have proper WSL support

And a corresponding den.ctx.wsl-host pipeline when WSL is enabled.

intoAttr is now a path.

You can change where a configuration is placed, this is useful for standalone home-manager and some WSL nixos configs.

den.homes.x86_64-darwin.tuxie = {
   intoPath = [ "homeConfigurations"  "tux@igloo" ];
}

noflakes template updated with multi-host suppot and nh apps.

Den can produce an nh based app for activating each host, this is currently only part of the noflake template, but will later be added to other flakes and documented on how to use in existing flakes.

What's Changed

  • Fix nix-maid link in noflake tutorial by @drupol in #194
  • Only apply unfree to nixos/darwin/homeManager by @OscarMarshall in #196
  • CI: tests first and templates until approved by @vic in #199
  • fix: den.fwd.adapter.user already defined by @vic in #202
  • fix include-less parametric in provides by @musjj in #208
  • Make intoAttr a path by @vic in #211
  • add wsl class and den.ctx.wsl-host by @vic in #213
  • Home integration now enabled via host config for hm, nix-maid, hjem by @vic in #215
  • docs by @vic in #217
  • move context apply functions to own file by @vic in #218
  • make batteries use parametric.exactly by @vic in #220
  • fix wrong location issue of option definied in den.default by @phhai-hcmut in #221
  • feat: os class forwards to NixOS and MacOS by @vic in #225
  • feat: apps per host for build/swith/repl using nix-community/nh by @vic in #227
  • remove duplicate code between homes by @vic in #229
  • feat: default.nix exposes clean den API without NixOS domain by @vic in #230
  • update flake-aspects, test no merged aspect.__functor by @vic in #231

New Contributors

Full Changelog: v0.10.0...v0.11.0