···18### `den._.define-user`
1920Creates OS-level user accounts (`users.users.<name>`) with `isNormalUser`,
21-`home`, and group. Sets `home-manager.users.<name>` when home-manager
22-integration is active.
2324### `den._.os-user`
2526-Assigns a user into the host by setting group membership and ensuring
27-the user account exists at the OS level.
2829### `den._.primary-user`
3031-Marks a user as the primary user of a host. Sets `nix.settings.trusted-users`
32-and can configure auto-login or default shell based on other batteries.
3334### `den._.user-shell`
3536-Sets the user's login shell. Reads `user.shell` and configures both
37-`users.users.<name>.shell` and the home-manager `programs.<shell>.enable`.
3839### `den._.tty-autologin`
40···4344### `den._.wsl`
4546-WSL-specific configuration. Enables `wsl.enable`, sets the default user,
47-and adjusts networking for WSL2 environments.
4849### `den._.forward`
5051-Forwards aspect configuration from one aspect to another. Used to chain
52-aspects without duplicating declarations.
5354### `den._.import-tree`
5556-Uses `inputs.import-tree` to recursively import a directory tree as
57-aspect modules. Enables file-system-driven aspect organization.
5859## Flake-parts batteries
006061### `den._.inputs'`
62···7071## Home-manager batteries
7273-### `den._.hm-integration`
07475-Integrates home-manager into NixOS/Darwin hosts. Imports the appropriate
76-home-manager module (`nixos` or `darwin`), enables
77-`home-manager.useGlobalPkgs` and `useUserPackages`.
7879-### `den._.hm-os`
8081-Merges home-manager configuration into the host OS module system. Bridges
82-`home-manager.users.<name>` with the user's aspect.
8384## Hjem batteries
8586-### `den._.hjem-integration`
87-88Integrates [hjem](https://github.com/feel-co/hjem) as an alternative to
89-home-manager. Imports hjem's NixOS module.
90-91-### `den._.hjem-os`
9293Merges hjem user configuration into the host. Sets `hjem.users.<name>`
94-from the user's aspect.
9596## Maid batteries
9798-### `den._.maid-integration`
99-100Integrates [maid](https://github.com/maid-nix/maid) as an alternative
101home management system.
102103-### `den._.maid-os`
104-105-Merges maid configuration into the host OS for each user.
106-107-## Unfree batteries
108109### `den._.unfree`
110111-Allows unfree packages globally via
112-`nixpkgs.config.allowUnfree = true`.
113-114-### `den._.unfree-predicate`
115-116-Allows unfree packages selectively using a predicate builder. Accepts
117-a list of package names and builds
118-`nixpkgs.config.allowUnfreePredicate`.
···18### `den._.define-user`
1920Creates OS-level user accounts (`users.users.<name>`) with `isNormalUser`,
21+and `home` directory. Works on NixOS/Darwin/WSL/HomeManager.
02223### `den._.os-user`
2425+A `user` class automatically enabled by Den to forward settings into the host's
26+`users.users.<userName>`. Forwards work into NixOS/Darwin classes.
2728### `den._.primary-user`
2930+Marks a user as the primary user (admin level) of a host. Works in NixOS/Darwin/WSL.
03132### `den._.user-shell`
3334+Sets the user's login shell.
35+`users.users.<name>.shell` enabling the shell at host, and the home-manager `programs.<shell>.enable`.
3637### `den._.tty-autologin`
38···4142### `den._.wsl`
4344+WSL-specific activation. Enables `den.ctx.wsl-host` when the `host.wsl.enable = true`
45+and includes NixOS-WSL module.
4647### `den._.forward`
4849+Forwards aspect configuration from one aspect to another.
50+Used for separation of conncerns. See Custom Classes section.
5152### `den._.import-tree`
5354+Provides `inputs.import-tree` helpers to import trees of non-dendritic
55+legacy modules, like a directory containing only nixos modules.
5657## Flake-parts batteries
58+59+These only work when the module system is flake-parts'.
6061### `den._.inputs'`
62···7071## Home-manager batteries
7273+Defines `den.ctx.hm-host` which activates when at least one user has `homeManager` classes.
74+The `hm-host` context can be used to set `home-manager.useGlobalPkgs` and `useUserPackages`.
7576+Merges home-manager configuration into the host OS module system. Bridges
77+`home-manager.users.<name>` with the user's `homeManager` class.
07879+Imports the appropriate home-manager module (`nixos` or `darwin`).
80008182## Hjem batteries
830084Integrates [hjem](https://github.com/feel-co/hjem) as an alternative to
85+home-manager. Imports hjem's NixOS/Darwin module.
008687Merges hjem user configuration into the host. Sets `hjem.users.<name>`
88+from the user's `hjem` class.
8990## Maid batteries
910092Integrates [maid](https://github.com/maid-nix/maid) as an alternative
93home management system.
9495+Merges maid configuration into the host OS `users.users.<name>.maid` for each user `maid` class.
00009697### `den._.unfree`
9899+Allows unfree packages by name via `nixpkgs.config.allowUnfreePredicate`.
0000000
+63-19
docs/src/content/docs/reference/schema.mdx
···10[`modules/_types.nix`](https://github.com/vic/den/blob/main/modules/_types.nix)
11</Aside>
1200000000000000000000000000000000000000000000000000000000000000013## `den.hosts`
1415Type: `attrsOf systemType`
···98| `*` | `den.base.home` options | | Options from base module |
99| `*` | | | free-form attributes |
100101-## `den.base`
102-103-Base modules merged into all hosts, users, or homes.
104-105-| Option | Type | Description |
106-|--------|------|-------------|
107-| `den.base.conf` | `deferredModule` | Applied to host, user, and home |
108-| `den.base.host` | `deferredModule` | Applied to all hosts (imports `conf`) |
109-| `den.base.user` | `deferredModule` | Applied to all users (imports `conf`) |
110-| `den.base.home` | `deferredModule` | Applied to all homes (imports `conf`) |
111-112-```nix
113-den.base.conf = { lib, ... }: {
114- # shared across all host/user/home declarations
115-};
116-den.base.host = { ... }: {
117- # host-specific base config
118-};
119-```
···10[`modules/_types.nix`](https://github.com/vic/den/blob/main/modules/_types.nix)
11</Aside>
1213+## Schema Base Modules
14+15+Each of `host`, `user`, `home` configuration objects have freeform-types,
16+meaning you can assign any attribute into them as meta-data.
17+18+However, at times you might want to have shared meta-data between all hosts
19+or all users.
20+21+The base modules, `den.base.*` serve for this purpose.
22+They are **not aspects**, they are meta-data (the attributes of host) that aspects
23+can later read for providing configuration.
24+25+For example, instead of:
26+27+```nix
28+den.hosts.x86_64-linux.igloo = {
29+ hardedned = true; # custom free-form metadata
30+31+ # repetitive
32+ users.alice.classes = [ "homeManager" ];
33+ users.bob.classes = [ "homeManager" ];
34+};
35+```
36+37+You can do:
38+39+```nix
40+# This is not an aspect, it is a meta-configuration of the host capabilities.
41+den.base.host = { host, lib, ... }: {
42+ options.hardened = lib.mkEnableOption "Is it secure";
43+ config.hardened = lib.mkDefault true;
44+};
45+46+# The meta-configuration module for all users
47+den.base.user = { user, lib, ... }: {
48+ config.classes = lib.mkDefault [ "homeManager" ];
49+};
50+```
51+52+All hosts you create will be `hardened = true` by default. And aspects will
53+be able to read `host.hardened` value.
54+55+## `den.base`
56+57+Base modules merged into all hosts, users, or homes.
58+59+| Option | Type | Description |
60+|--------|------|-------------|
61+| `den.base.conf` | `deferredModule` | Applied to host, user, and home |
62+| `den.base.host` | `deferredModule` | Applied to all hosts (imports `conf`) |
63+| `den.base.user` | `deferredModule` | Applied to all users (imports `conf`) |
64+| `den.base.home` | `deferredModule` | Applied to all homes (imports `conf`) |
65+66+```nix
67+den.base.conf = { lib, ... }: {
68+ # shared across all host/user/home declarations
69+};
70+den.base.host = { ... }: {
71+ # host-specific base config
72+};
73+```
74+75+76## `den.hosts`
7778Type: `attrsOf systemType`
···161| `*` | `den.base.home` options | | Options from base module |
162| `*` | | | free-form attributes |
1630000000000000000000