···3333## Host Schema
34343535<Aside title="Important" icon="nix">
3636-Be sure to read about the entity [Schemas](/reference/schema/), each of `host`/`user`/`home` has a corresponding `den.base.*` module for meta-configuration. Which can later be used in aspects that read from `host`. These schemas are the meta-data equivalent of what Dendritic flake-parts users do with flake-level options.
3636+Be sure to read about the entity [Schemas](/reference/schema/), each of `host`/`user`/`home` has a corresponding `den.schema.*` module for meta-configuration. Which can later be used in aspects that read from `host`. These schemas are the meta-data equivalent of what Dendritic flake-parts users do with flake-level options.
3737</Aside>
38383939Hosts have these options (all with sensible defaults):
···4848| `instantiate` | class-dependent | `lib.nixosSystem`, `darwinSystem`, etc. |
4949| `intoAttr` | class-dependent | Flake output path |
5050| `users` | `{}` | User account definitions |
5151-| `*` | from `den.base.host` | Any option defined by base module |
5151+| `*` | from `den.schema.host` | Any option defined by base module |
5252| `*` | | Any other free-form attribute |
53535454## User Declaration
···7070| `userName` | `name` | System account name |
7171| `aspect` | `name` | Primary aspect name |
7272| `classes` | `[ "homeManager" ]` | Nix classes this user participates in |
7373-| `*` | from `den.base.user` | Any option defined by base module |
7373+| `*` | from `den.schema.user` | Any option defined by base module |
7474| `*` | | Any other free-form attribute |
75757676## Standalone Homes
···9797| `aspect` | `name` | Primary aspect name |
9898| `pkgs` | `inputs.nixpkgs.legacyPackages.${system}` | nixpkgs instance |
9999| `instantiate` | `inputs.home-manager.lib.homeManagerConfiguration` | Builder function |
100100-| `*` | from `den.base.host` | Any option defined by base module |
100100+| `*` | from `den.schema.host` | Any option defined by base module |
101101| `*` | | Any other free-form attribute |
102102103103## Base Modules
104104105105-`den.base.{host,user,home,conf}` provides shared configuration applied to all entities of each kind.
105105+`den.schema.{host,user,home,conf}` provides shared configuration applied to all entities of each kind.
106106107107Some batteries also extend base modules [see `hjem-os.nix`](https://github.com/vic/den/blob/main/modules/aspects/provides/hjem/hjem-os.nix#L50) which defines `hjem.module` option.
108108109109```nix
110110{
111111 # Can be used to config each host
112112- den.base.host.home-manager.enable = true;
112112+ den.schema.host.home-manager.enable = true;
113113114114 # Can be used to add schema options with defaults
115115- den.base.user = { user, lib, ... }: {
115115+ den.schema.user = { user, lib, ... }: {
116116 options.groupName = lib.mkOption { default = user.userName; };
117117 };
118118119119 # Applied to every host and user and home.
120120- den.base.conf = {
120120+ den.schema.conf = {
121121 options.copyright = lib.mkOption { default = "Copy-Left"; };
122122 };
123123}
+2-2
docs/src/content/docs/guides/home-manager.mdx
···2626den.hosts.x86_64-linux.igloo.users.tux.classes = [ "homeManager" "hjem" ];
27272828# As default for all users, unless they specify other classes.
2929-den.base.user.classes = lib.mkDefault [ "homeManager" ];
2929+den.schema.user.classes = lib.mkDefault [ "homeManager" ];
3030```
31313232Home integration contexts, like `den.ctx.hm-host` only activate when
···105105};
106106107107# On all hosts
108108-den.base.host.hjem.enable = true;
108108+den.schema.host.hjem.enable = true;
109109```
110110111111### Requirements
+1-1
docs/src/content/docs/index.mdx
···154154```
155155156156<Steps>
157157-1. **Schema** -- `den.hosts` and `den.homes` declare machines, users, and their properties with `den.base` modules and extensible freeform types.
157157+1. **Schema** -- `den.hosts` and `den.homes` declare machines, users, and their properties with `den.schema` modules and extensible freeform types.
1581582. **Aspects** -- `den.aspects.*` bundles per-class configs (`nixos`, `darwin`, `homeManager`, or any custom class) with `.includes` and `.provides` forming a DAG.
1591593. **Context pipeline** -- `den.ctx` transforms schema entries into context pairs (`{host}`, `{host, user}`, `{home}`), walking `into.*` transitions for derived contexts like `hm-host`, `hm-user`, `wsl-host` or any other custom context stage.
1601604. **Resolution** -- Parametric dispatch via `__functor` argument introspection. Functions receive only contexts whose shape matches their parameters.
+1-1
docs/src/content/docs/motivation.mdx
···77777878- How to define common [schemas](/guides/declare-hosts#base-modules) (options) for these entities.
79798080- `den.base.host.options.vpn-group = lib.mkOption`
8080+ `den.schema.host.options.vpn-group = lib.mkOption`
81818282- How to [include features](/guides/batteries) that affect all entities
8383
···23232424 For all users unless they set a value:
25252626- den.base.user.classes = lib.mkDefault [ "homeManager" ];
2626+ den.schema.user.classes = lib.mkDefault [ "homeManager" ];
27272828 On specific users:
2929