1.6 KiB
1.6 KiB
Playbook: Add a NixOS Module
- Name: Add a module under
modules/<category>/ - Purpose: Introduce a new module following auto-import and toggle conventions.
- Prerequisites: Identify target host(s) and toggle category; confirm
my.secureHostif secrets are involved. - Inputs: Module name, category (apps/dev/scripts/servers/services/shell/network), required options, secret needs, proxy requirements if server-facing.
- Steps:
- Choose the category path from
docs/reference/index.mdand createmodules/<category>/<name>.nix(auto-import picks it up; avoid names filtered out such aslibrewolf.nix). - Define options under
my.<category>or reuse factories (mkserverfor servers,mkscriptfor scripts) instead of hand-rolled patterns. - If the module needs secrets, guard references with
lib.mkIf config.my.secureHostand map them to the correct secrets file (see secrets map). - For networked services, align host selection with
my.mainServerandmy.ips; enable reverse proxy viaenableProxywhen applicable. - Wire toggles for target hosts in
hosts/<host>/toggles.nix, ensuring users/groups and containers/proxy flags are set.
- Choose the category path from
- Validation:
- Module loads without extra imports (auto-import applies).
- Toggle wiring matches intended hosts; secureHost gating present for secrets.
- Proxy and port choices align with
my.mainServer,my.ips, and firewall rules.
- Outputs: New module file and updated host toggles if required.
- References:
docs/constitution.md(Module Categories, Secrets Map, Main server and proxies),docs/reference/index.md(Module Directories, Proxy rules, Secrets Map)