···1818### `den._.define-user`
19192020Creates OS-level user accounts (`users.users.<name>`) with `isNormalUser`,
2121-`home`, and group. Sets `home-manager.users.<name>` when home-manager
2222-integration is active.
2121+and `home` directory. Works on NixOS/Darwin/WSL/HomeManager.
23222423### `den._.os-user`
25242626-Assigns a user into the host by setting group membership and ensuring
2727-the user account exists at the OS level.
2525+A `user` class automatically enabled by Den to forward settings into the host's
2626+`users.users.<userName>`. Forwards work into NixOS/Darwin classes.
28272928### `den._.primary-user`
30293131-Marks a user as the primary user of a host. Sets `nix.settings.trusted-users`
3232-and can configure auto-login or default shell based on other batteries.
3030+Marks a user as the primary user (admin level) of a host. Works in NixOS/Darwin/WSL.
33313432### `den._.user-shell`
35333636-Sets the user's login shell. Reads `user.shell` and configures both
3737-`users.users.<name>.shell` and the home-manager `programs.<shell>.enable`.
3434+Sets the user's login shell.
3535+`users.users.<name>.shell` enabling the shell at host, and the home-manager `programs.<shell>.enable`.
38363937### `den._.tty-autologin`
4038···43414442### `den._.wsl`
45434646-WSL-specific configuration. Enables `wsl.enable`, sets the default user,
4747-and adjusts networking for WSL2 environments.
4444+WSL-specific activation. Enables `den.ctx.wsl-host` when the `host.wsl.enable = true`
4545+and includes NixOS-WSL module.
48464947### `den._.forward`
50485151-Forwards aspect configuration from one aspect to another. Used to chain
5252-aspects without duplicating declarations.
4949+Forwards aspect configuration from one aspect to another.
5050+Used for separation of conncerns. See Custom Classes section.
53515452### `den._.import-tree`
55535656-Uses `inputs.import-tree` to recursively import a directory tree as
5757-aspect modules. Enables file-system-driven aspect organization.
5454+Provides `inputs.import-tree` helpers to import trees of non-dendritic
5555+legacy modules, like a directory containing only nixos modules.
58565957## Flake-parts batteries
5858+5959+These only work when the module system is flake-parts'.
60606161### `den._.inputs'`
6262···70707171## Home-manager batteries
72727373-### `den._.hm-integration`
7373+Defines `den.ctx.hm-host` which activates when at least one user has `homeManager` classes.
7474+The `hm-host` context can be used to set `home-manager.useGlobalPkgs` and `useUserPackages`.
74757575-Integrates home-manager into NixOS/Darwin hosts. Imports the appropriate
7676-home-manager module (`nixos` or `darwin`), enables
7777-`home-manager.useGlobalPkgs` and `useUserPackages`.
7676+Merges home-manager configuration into the host OS module system. Bridges
7777+`home-manager.users.<name>` with the user's `homeManager` class.
78787979-### `den._.hm-os`
7979+Imports the appropriate home-manager module (`nixos` or `darwin`).
80808181-Merges home-manager configuration into the host OS module system. Bridges
8282-`home-manager.users.<name>` with the user's aspect.
83818482## Hjem batteries
85838686-### `den._.hjem-integration`
8787-8884Integrates [hjem](https://github.com/feel-co/hjem) as an alternative to
8989-home-manager. Imports hjem's NixOS module.
9090-9191-### `den._.hjem-os`
8585+home-manager. Imports hjem's NixOS/Darwin module.
92869387Merges hjem user configuration into the host. Sets `hjem.users.<name>`
9494-from the user's aspect.
8888+from the user's `hjem` class.
95899690## Maid batteries
97919898-### `den._.maid-integration`
9999-10092Integrates [maid](https://github.com/maid-nix/maid) as an alternative
10193home management system.
10294103103-### `den._.maid-os`
104104-105105-Merges maid configuration into the host OS for each user.
106106-107107-## Unfree batteries
9595+Merges maid configuration into the host OS `users.users.<name>.maid` for each user `maid` class.
1089610997### `den._.unfree`
11098111111-Allows unfree packages globally via
112112-`nixpkgs.config.allowUnfree = true`.
113113-114114-### `den._.unfree-predicate`
115115-116116-Allows unfree packages selectively using a predicate builder. Accepts
117117-a list of package names and builds
118118-`nixpkgs.config.allowUnfreePredicate`.
9999+Allows unfree packages by name via `nixpkgs.config.allowUnfreePredicate`.
+63-19
docs/src/content/docs/reference/schema.mdx
···1010[`modules/_types.nix`](https://github.com/vic/den/blob/main/modules/_types.nix)
1111</Aside>
12121313+## Schema Base Modules
1414+1515+Each of `host`, `user`, `home` configuration objects have freeform-types,
1616+meaning you can assign any attribute into them as meta-data.
1717+1818+However, at times you might want to have shared meta-data between all hosts
1919+or all users.
2020+2121+The base modules, `den.base.*` serve for this purpose.
2222+They are **not aspects**, they are meta-data (the attributes of host) that aspects
2323+can later read for providing configuration.
2424+2525+For example, instead of:
2626+2727+```nix
2828+den.hosts.x86_64-linux.igloo = {
2929+ hardedned = true; # custom free-form metadata
3030+3131+ # repetitive
3232+ users.alice.classes = [ "homeManager" ];
3333+ users.bob.classes = [ "homeManager" ];
3434+};
3535+```
3636+3737+You can do:
3838+3939+```nix
4040+# This is not an aspect, it is a meta-configuration of the host capabilities.
4141+den.base.host = { host, lib, ... }: {
4242+ options.hardened = lib.mkEnableOption "Is it secure";
4343+ config.hardened = lib.mkDefault true;
4444+};
4545+4646+# The meta-configuration module for all users
4747+den.base.user = { user, lib, ... }: {
4848+ config.classes = lib.mkDefault [ "homeManager" ];
4949+};
5050+```
5151+5252+All hosts you create will be `hardened = true` by default. And aspects will
5353+be able to read `host.hardened` value.
5454+5555+## `den.base`
5656+5757+Base modules merged into all hosts, users, or homes.
5858+5959+| Option | Type | Description |
6060+|--------|------|-------------|
6161+| `den.base.conf` | `deferredModule` | Applied to host, user, and home |
6262+| `den.base.host` | `deferredModule` | Applied to all hosts (imports `conf`) |
6363+| `den.base.user` | `deferredModule` | Applied to all users (imports `conf`) |
6464+| `den.base.home` | `deferredModule` | Applied to all homes (imports `conf`) |
6565+6666+```nix
6767+den.base.conf = { lib, ... }: {
6868+ # shared across all host/user/home declarations
6969+};
7070+den.base.host = { ... }: {
7171+ # host-specific base config
7272+};
7373+```
7474+7575+1376## `den.hosts`
14771578Type: `attrsOf systemType`
···98161| `*` | `den.base.home` options | | Options from base module |
99162| `*` | | | free-form attributes |
100163101101-## `den.base`
102102-103103-Base modules merged into all hosts, users, or homes.
104104-105105-| Option | Type | Description |
106106-|--------|------|-------------|
107107-| `den.base.conf` | `deferredModule` | Applied to host, user, and home |
108108-| `den.base.host` | `deferredModule` | Applied to all hosts (imports `conf`) |
109109-| `den.base.user` | `deferredModule` | Applied to all users (imports `conf`) |
110110-| `den.base.home` | `deferredModule` | Applied to all homes (imports `conf`) |
111111-112112-```nix
113113-den.base.conf = { lib, ... }: {
114114- # shared across all host/user/home declarations
115115-};
116116-den.base.host = { ... }: {
117117- # host-specific base config
118118-};
119119-```