Fleet is managed as a Nix flake and deployed with Colmena, so changes should always keep host reproducibility front of mind. Use this guide to stay consistent with the existing configuration style.
flake.nixwires external inputs and exposes the Colmena hive plus the development shell.hosts.nixis the single inventory; per-host configs live inhosts/<name>/alongside hardware profiles and shared logic inhosts/common.nix.- Service modules are grouped under
modules/<domain>/and exposed via thefleet.<domain>.<service>option namespace (e.g.modules/dev/gitea.nix). - Keep assets such as TLS material inside the relevant module options (
fleet.security.*) rather than committing secrets.
nix developbrings up the shell with Colmena installed; run it before modifying modules.nix flake checkensures all modules evaluate and option contracts stay valid.colmena apply --on alpha --dry-run switchvalidates thealphahost without touching state; drop--dry-runto deploy.colmena apply --on bravo switchpublishes Git services; prefer tagging multiple hosts via thehosts.nixtags when coordinating changes.
- Use two-space indentation and keep attribute sets alphabetised where practical.
- Follow the existing section banners (
# ===) and organise modules asoptionsthenconfig. - Name options
fleet.<domain>.<service>and expose user-tunable settings throughmkOptionwith informative defaults. - Prefer descriptive attribute keys (
domain,port,description) and consistent casing for hostnames and routes.
- Extend or adjust modules under
modules/and rerunnix flake checkbefore review. - For behavioural changes, exercise
colmena apply --on <host> --dry-run switchto confirm activations succeed. - Capture any manual verification (e.g. Grafana reachable on port 3000) in the pull request notes so reviewers can mirror the checks.
- Match the existing history of short, lower-case imperative summaries (e.g.
adding reverse proxy). - Each PR should explain the motivation, list affected hosts or services, and call out required secrets or DNS updates.
- Include screenshots or command transcripts when modifying user-facing dashboards or endpoints.
- Reference related issues or host tags for traceability, and ensure CI/CD or deployment checks are linked before requesting review.