···211211|---|---|
212212| `helium.nix` | Adds `helium` browser to nixpkgs from `github:ominit/helium-browser-flake`. |
213213| `nil.nix` | Pins `nil` (Nix LSP) to a specific revision with a custom `cargoHash`. |
214214+| `pi-coding-agent.nix` | Adds `pi-coding-agent` to nixpkgs from `github:numtide/llm-agents.nix`. Included by kats-laptop. |
214215215216Overlays declare their own flake inputs, so removing the overlay removes the dependency:
216217
+2-2
to-kat/common-tasks.md
···22222323For WSL or Raspberry Pi, substitute the hostname:
2424```bash
2525-nh os switch .#wsl
2626-nh os switch .#rpi
2525+nh os switch .#kats-wsl
2626+nh os switch .#kats-rpi
2727```
28282929---
+33-6
to-kat/files-vm-nh-dendritic-defaults.md
···12121313```nix
1414# den + flake-file wiring. nixpkgs and home-manager kept in sync.
1515-{ inputs, ... }:
1515+{ inputs, den, ... }:
1616{
1717 imports = [
1818 (inputs.flake-file.flakeModules.dendritic or { })
1919 (inputs.den.flakeModules.dendritic or { })
2020+ inputs.agenix-rekey.flakeModule
2121+ inputs.home-manager.flakeModules.home-manager
2022 ];
2323+2424+ den.schema.user.includes = [ den._.mutual-provider ];
21252226 systems = [
2327 "x86_64-linux"
···40444145| Line | Meaning |
4246|---|---|
4343-| `imports = [ ... ]` | Imports the `dendritic` flake module from both `flake-file` and `den`. The `or { }` prevents errors if the module isn't found. |
4747+| `imports = [ ... ]` | Imports the `dendritic` flake module from both `flake-file` and `den`, plus `agenix-rekey` and `home-manager` flake modules. The `or { }` prevents errors if the module isn't found. |
4848+| `den.schema.user.includes` | Adds the `mutual-provider` battery to every user, enabling host→user and user→host config forwarding (e.g., `provides.to-users`, `provides.<username>`). |
4449| `systems = [ ... ]` | Architectures this config targets. Both x86_64 (laptops, WSL) and aarch64 (Raspberry Pi). |
4550| `flake-file.inputs.den` | The `den` framework itself. |
4651| `flake-file.inputs.flake-file` | Auto-flake generator. |
4752| `flake-file.inputs.nixpkgs` | Pinned to `nixos-26.05` (stable). |
4848-| `flake-file.inputs.home-manager` | Pinned to `release-26.05`, following the same nixpkgs. Keeps home-manager and nixpkgs in sync. |
5353+| `flake-file.inputs.home-manager` | Pinned to `release-26.05`, following the same nixpkgs. Keeps home-manager and home-manager in sync. |
49545055### Why a Single Wiring File?
5156···61666267```nix
6368# den.default — applied to every host and user automatically.
6464-{ lib, den, ... }:
6969+{
7070+ lib,
7171+ den,
7272+ self,
7373+ inputs,
7474+ ...
7575+}:
6576{
6677 den.default.includes = [
6778 den.batteries.hostname
6879 (den.batteries.define-user { })
6980 ];
70818282+ den.default.nixos = {
8383+ home-manager.backupFileExtension = "bk";
8484+8585+ nix.settings.experimental-features = [ "nix-command" "flakes" ];
8686+8787+ environment.etc."nixos-config" = { source = ../.; };
8888+8989+ system.configurationRevision = lib.mkDefault (
9090+ inputs.self.rev or self.rev or "dirty"
9191+ );
9292+ };
9393+7194 den.schema.user.classes = lib.mkDefault [ "homeManager" ];
7295}
7396```
···78101|---|---|
79102| `den.batteries.hostname` | Auto-sets `networking.hostName` to the host entity name. You don't need `networking.hostName = "kats-laptop"` anywhere — it's automatic. |
80103| `den.batteries.define-user { }` | Auto-creates `users.users.<name>.isNormalUser = true` for every user declared in `hosts/default.nix`. With empty args, uses defaults. |
104104+| `home-manager.backupFileExtension` | If home-manager would overwrite an existing dotfile, it renames the old one with a `.bk` suffix instead of failing. Prevents activation errors on existing `gh/config.yml`, `jj/config.toml`, `atuin/config.toml`, etc. |
105105+| `nix.settings.experimental-features` | Required for flakes. |
106106+| `environment.etc."nixos-config"` | Captures the full flake source in the Nix store, so it's available at runtime (safe from accidental deletion). |
107107+| `system.configurationRevision` | Tags the generation with the git/jj revision for rollback identification. |
81108| `den.schema.user.classes` | Sets the default user class to `[ "homeManager" ]`, meaning home-manager config runs for every user unless overridden (see `kat` user). |
8210983110### `lib.mkDefault` and Overrides
···115142116143```
117144packages.x86_64-linux.kats-laptop
118118-packages.x86_64-linux.wsl
119119-packages.aarch64-linux.rpi
145145+packages.x86_64-linux.kats-wsl
146146+packages.aarch64-linux.kats-rpi
120147```
121148122149`nh` finds these and lets you run:
+11-6
to-kat/secrets-management.md
···1515 │
1616 agenix-rekey
1717 │
1818- ┌──────────┼──────────┐
1919- │ │ │
2020- ┌────▼────┐ ┌──▼──┐ ┌───▼───┐
2121- │kats- │ │kats-│ │kats- │ ← per-host encrypted
2222- │laptop │ │wsl │ │rpi │ copies in secrets/
2323- └─────────┘ └─────┘ └───────┘
1818+ ┌──────────┼──────────────────┐
1919+ │ │ │
2020+ ┌────▼────┐ ┌──▼──────────┐ ┌──────────▼───┐
2121+ │kats- │ │kats- │ │kats- │ ← per-host encrypted
2222+ │laptop │ │wsl │ │rpi │ copies in secrets/
2323+ └─────────┘ └──────┬──────┘ └────────┬─────┘
2424+ │ │
2525+ (disabled— (disabled—
2626+ FIXME pubkey) FIXME pubkey)
2427```
2828+2929+> **Note**: Minimal hosts (`kats-wsl`, `kats-rpi`) currently have secrets **disabled** — their `age.rekey.hostPubkey` is set to a placeholder (`# FIXME: replace with actual host pubkey`) and the `gitKey` secret has `enable = false`. To enable secrets on these hosts, get their actual SSH host pubkey, update `age.rekey.hostPubkey`, remove the `enable = false`, and run `agenix rekey -a`.
25302631- **Source secrets** live in their aspect folder (e.g. `modules/aspects/programs/git/gitKey.age`)
2732- Encrypted with your **master identity** (`~/.config/agenix/identity.txt`, converted from `~/.ssh/id_ed25519`)
+19
to-kat/the-den-framework.md
···6565 den.batteries.hostname # auto-detect hostname
6666 (den.batteries.define-user { }) # auto-create user skeletons
6767];
6868+6969+den.default.nixos.home-manager.backupFileExtension = "bk";
7070+6871den.schema.user.classes = lib.mkDefault [ "homeManager" ];
6972```
7373+7474+The `nixos` section of `den.default` applies to every host. Notably `home-manager.backupFileExtension = "bk"` prevents activation failures when home-manager would overwrite existing user dotfiles — the old file gets renamed with a `.bk` extension instead.
70757176### `den.batteries`
7277···74797580- **`den.batteries.hostname`** — Automatically sets `networking.hostName` based on the host's entity name. No need to manually set hostname in each host config.
7681- **`den.batteries.define-user`** — Auto-creates user entries (`users.users.<name>.isNormalUser = true`) for every user declared in `hosts/default.nix`. With `{ }` (empty args), it uses defaults.
8282+8383+### `den.schema.user.includes`
8484+8585+Controls which aspects are included for every user automatically. Set in `dendritic.nix`:
8686+8787+```nix
8888+den.schema.user.includes = [ den._.mutual-provider ];
8989+```
9090+9191+This enables the **mutual-provider** battery, which lets host aspects deliver config to their users (and vice versa) without the user aspect needing to explicitly include program aspects.
9292+9393+**Result**: A host aspect can use `provides.to-users` or `provides.<username>` to forward `homeManager` config to specific users. For example, `den.aspects.kats-laptop.provides.ksakura.includes = [ den.aspects.cli ]` delivers helix's home-manager config to ksakura without the user aspect including it.
9494+9595+**Why this exists**: Program aspects define their home-manager config under `den.aspects.programs.<name>.homeManager`, but the den system only forwards `homeManager` sections to users when the user aspect (or an aspect in its include chain) contains them. The mutual-provider battery bridges this gap by allowing the host aspect to "provide" config to its users.
77967897### `den.schema.user.classes`
7998