The generator
The generator (src/generator/, written in Rust) transforms the declarative
configuration etc/config.yaml into Nix code consumed by the framework.
From YAML to Nix
Section titled “From YAML to Nix”- Input:
etc/config.yaml→ hosts, users, network, services. - Output:
var/generated/→hosts.nix,users.nix,network.nix.
These files are generated: never edit them by hand. To regenerate them after a configuration change:
just generateThe flow
Section titled “The flow”A single source of truth (etc/config.yaml) is transformed into deterministic Nix code, consumed by the framework via flake.nix.
Commands
Section titled “Commands”The generator exposes one command per target. just generate chains them all together; you can also invoke a single one.
| Command | Output | Content |
|---|---|---|
hosts | var/generated/hosts.nix | Hosts: profiles, services, colmena tags. |
users | var/generated/users.nix | Users: profiles, groups. |
network | var/generated/network.nix | Topology: zones, DNS, VPN. |
disko | usr/machines/<hôte>/disko.nix | Per-host partitioning. |
doc | */ref/modules.mdx | Module reference (documentation). |
just generate # regenerate everything (via the Justfile)just codegen # regenerate only the module reference (doc)Execution context
Section titled “Execution context”The generator runs in two modes, chosen automatically:
- Co-development (sources +
cargopresent) →cargo run: fast compilation loop while modifying the generator. - Release (no local checkout) →
dnf-generatorbinary provided by the framework’s devShell (nix develop github:darkone-linux/...).