Requirements
Before submitting changes, ensure:- All Nix files are formatted — Run
nix fmtbefore committing - All tests pass — Run
nix flake check - Commit messages follow Conventional Commits — e.g.,
feat:,fix:,chore:
Development commands
| Command | Description |
|---|---|
nix flake check | Validate configuration and run all tests |
nix fmt | Format all code (nixfmt, deadnix, statix, shellcheck, yamlfmt) |
nix develop | Enter development shell with necessary tools |
nix flake show | Display all flake outputs |
nix run | Run a QEMU VM with all features enabled (x86_64-linux) |
Code formatting
nix fmt runs multiple tools:
- nixfmt — Nix code formatting
- deadnix — Unused variable detection
- statix — Nix linting
- shellcheck — Shell script linting
- yamlfmt — YAML formatting
nix fmt -- --ci.
Adding features
- Create the module file in the appropriate
modules/subdirectory - Add the import to the corresponding
default.nix - Define new options in
modules/nixos/options.nixundermarchyo.* - Add an evaluation test in
tests/module-tests.nix - Run
nix fmtandnix flake check