-
-
Notifications
You must be signed in to change notification settings - Fork 43
v0.13.0 #314
-
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 feat(batteries): Opt-in den._.bidirectional #272
- Add hjem to noflake example by @vic in Add hjem to noflake example #275
- feat(batteries): mutual provider can configure generic users and hosts by @vic in feat(batteries): mutual provider can configure generic users and hosts #283
- feat(core): Add host fixed-point in user schema. by @vic in feat(core): Add host fixed-point in user schema. #284
- feat(batteries): allow mutual-provider pass ctx to generic aspect by @vic in feat(batteries): allow mutual-provider pass ctx to generic aspect #285
- feat(lib): den.lib.perHost and den.lib.perUser by @vic in feat(lib): den.lib.perHost and den.lib.perUser #288
- improve(lib): split lib.nix into files by @vic in improve(lib): split lib.nix into files #290
- docs: clarify how to enable angle-brackets in a file by @crasm in docs: clarify how to enable angle-brackets in a file #291
- fix(ctx): should not use hm from host when no-bidir enabled. by @vic in fix(ctx): should not use hm from host when no-bidir enabled. #293
- doc: expand on docs contribution instructions by @crasm in doc: expand on docs contribution instructions #295
- fix(batteries): den._.bidirectional uses fixedTo to include from host. by @vic in fix(batteries): den._.bidirectional uses fixedTo to include from host. #298
- feat(repo): Add devShell for tooling by @vic in feat(repo): Add devShell for tooling #299
- docs: remove absolute size from main den logo by @crasm in docs: remove absolute size from main den logo #301
- docs: fix console command style in contributing.md by @crasm in docs: fix console command style in contributing.md #302
- feat(lib): add den.lib.perHome and add documentation for context shortcuts by @HeitorAugustoLN in feat(lib): add den.lib.perHome and add documentation for context shortcuts #303
- fix(ci): Test using nh apps for minimal and noflake. by @vic in fix(ci): Test using nh apps for minimal and noflake. #305
- feat(homes): OS bound standalone HM by @vic in feat(homes): OS bound standalone HM #306
- feat(class): Allow test config values on forward classes. by @vic in feat(class): Allow test config values on forward classes. #307
- feat(batteries): remove bidirectional by @vic in feat(batteries): remove bidirectional #308
- feat(class): Allow top-level forwarded-alias classes by @vic in feat(class): Allow top-level forwarded-alias classes #309
- fix(bug): nested plain-attrs aspects are parametric by @vic in fix(bug): nested plain-attrs aspects are parametric #312
New Contributors
- @crasm made their first contribution in docs: clarify how to enable angle-brackets in a file #291
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
- Mutual host/user routing replaces bidirectional battery
den._.bidirectionalwas first extracted from Den core into a battery and then removed.den._.mutual-provideris 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>orden.aspects.<host>.provides.<user>
- host -> users:
- Forwarding classes now support top-level alias forwarding
den._.forwardnow supportsintoPath = [ ]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.
- Parametric behavior fix for nested plain-attrs includes
- Nested includes are treated correctly as parametric when function args are declared.
- New context helpers in
den.lib
den.lib.perHostden.lib.perUserden.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.
- Better den.lib and framework module organization
- Core lib split into
nix/lib/*modules. default.nixandflake.nixare basically the same.
Migration Notes
1) Replace bidirectional patterns
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:
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>.userNameso that batteries likedefine-userwork. - 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
latesttag upon release, docs/test workflow changes, semantic PR updates. - Added
shell.nixand exporteddevShellsfrom 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
- Remove any
den._.bidirectionalusage. - Enable mutual routing explicitly with
den.ctx.user.includes = [ den._.mutual-provider ];where needed. - Move host->user routing to
<host>.provides.to-usersand user->host routing to<user>.provides.to-hosts. - Replace
den.lib.take.atLeast/exactlyincludes withperHost/perUser/perHomewhere appropriate.
This discussion was created from the release v0.13.0.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 4