-
-
Notifications
You must be signed in to change notification settings - Fork 43
v0.10.0 #193
-
Den v0.10.0
Highlights
Updated documentation
I have put a lot of my time on trying to detail as much as I can about Den in the docs. As always everyone is invited to improve the docs and fix my english grammar-errors/typos.
As always the source of truth is the source code itself, and all CI tests are self-isolated intended to be used also as complete den examples each of them.
bogus and CI run on MacOS (again)
To enable people contribute more tests to Den. I've also updated the bogus repo with cleaner test setup, in hope that people can contribute more tests. You are welcome to send PRs with new tests even if they are failing and have no fix, the bogus and CI templates both use the same test helpers. Also updated docs about this.
den.ctx now deduplicates includes at context-application time docs code.
Den keeps track of which aspect-owned configs have already been seen, but functional includes are always called (there's no way for den to know { host, user } was included elsewhere). However this static config deduplication already fixes some failing tests contributed from bogus-reports.
The documented recommendation is not to naively use den.default.includes = [ ({ host, ... }: ...) ], and prefer including at specific host or den.ctx.host and friends. Or read about the documented limitations of den.default and the need of take.exactly.
Den now has a user class that works on NixOS and nix-Darwin.
This is powered by our den.provides.forward higher-order aspect,
the exact same that powers our homeManager class.
User aspects can use the user class to specify any setting that will be forwarded to the host: nixos.users.users.<username>:
# works with static configs den.aspects.tux.user.extraGroups = [ "wheel" ]; # can also access the host pkgs and osConfig den.aspects.tux.user = { pkgs, osConfig, ... }: { packages = [ pkgs.hello ]; }
This is a convenience for people like me not using homeManager.
Users can now declare many home-environment classes.
Previously user.class defaulted to "homeManager", now it was replaced by user.classes defaults to [ "homeManager" ],
this is because a user might want to manage some files using nix-maid or hjem instead or addition to homeManager.
These two work exactly like homeManager does, that means we also have den.ctx.maid-host and den.ctx.hjem-host context types that are activated when a host has users with the corresponding user.classes.
Guarded forward classes.
This is another feature built on top of den.provides.forward.
People requested the following feature: I want my aspect to assign configs directly to a class and that config be included in the host only if some third-party module was imported (main use case was Impermanence options):
Aspect defines config under a custom user-defined persist class:
# any file can contribute to persist class { den.aspects.tux.persist.directories = [ "Firefox/.mozilla" ]; }
host defines how and when the persist class is forwarded into the host configuration. all other files need not to be filled with mkIf or any other conditional checking for impermanence support, only one file does this:
persist = { host }: { class, aspect-chain }: den._.forward { each = lib.attrValues host.users; fromClass = _: "persist"; intoClass = _: class; # nixos or darwin, dynamically. # path taken from https://nixos.wiki/wiki/Impermanence intoPath = user: [ "home-manager" "users" user.userName "home" "persistance" "/nix/dotfiles" ]; fromAspect = user: den.aspects.${user.aspect}; guard = { options, ... }: options ? environment.persistance; # takes nixos module args and checks if impermanence was imported }; den.hosts.my-laptop.includes = [ persist ];
What's Changed
userclass, convenience for OSusers.users.userNameby @vic inuserclass, convenience for OSusers.users.userName#170- fix: add missing
noflaketemplate by @drupol in fix: add missingnoflaketemplate #178 - Remove OS from example defaults.nix by @OscarMarshall in Remove OS from example defaults.nix #179
- Dedup includes on ctxApply by @vic in Dedup includes on ctxApply #185
- Improve Docs by @vic in Improve Docs #186
- update flake-file (removes systems input) by @vic in update flake-file (removes systems input) #187
- run tests and bogus on linux and macos by @vic in run tests and bogus on linux and macos #188
- add hm-host isolation test by @vic in add hm-host isolation test #189
- user class modules can take os-level pkgs and osConfig. by @vic in user class modules can take os-level pkgs and osConfig. #190
- A single user can support many classes: homeManager / hjem / maid by @vic in A single user can support many classes: homeManager / hjem / maid #191
- hjem support by @vic in hjem support #173
- nix-maid integration by @vic in nix-maid integration #172
- Guarded classes for configs that depend on options presence. (eg Impermanence) by @vic in Guarded classes for configs that depend on options presence. (eg Impermanence) #192
New Contributors
- @drupol made their first contribution in fix: add missing
noflaketemplate #178 - @OscarMarshall made their first contribution in Remove OS from example defaults.nix #179
Full Changelog: v0.9.0...v0.10.0
This discussion was created from the release v0.10.0.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 4