3.7 KiB
Coding-agent workflow
This repository exposes deterministic validation and narrowly scoped research tools for Codex, OpenCode, and editor agents. Live system activation is outside this workflow.
Validation commands
Use task-owned paths during the edit loop:
nix run .#check -- plan --paths modules/applications/example/home.nix --json
nix run .#check -- fast --paths modules/applications/example/home.nix
nix run .#check -- eval --paths modules/applications/example/home.nix
nix run .#check -- build --paths modules/applications/example/home.nix
nix run .#check -- all --paths modules/applications/example/home.nix
For a committed pull-request range, replace --paths ... with
--base <base-sha>. full is reserved for CI, scheduled maintenance, or an
explicit repository-wide audit:
nix run .#check -- full
The stages have distinct meanings:
planmaps changed paths to Registry units, reversemeta.includesdependencies, real hosts, and compatible build systems.fastparses changed Nix files, validates JSON, TOML, Python, and Agent Skill frontmatter, checks whitespace, and runs configured hooks only for the selected files.evalinstantiates affected NixOS and nix-darwin configurations. Flake-wide, validation-tool, shell, overlay, and test changes additionally evaluate every flake system.buildrealizes affected configurations supported by the current platform with no result link. Incompatible targets remain evaluation-only until a matching runner handles them.allperforms task-scoped file checks, all-system evaluation, and compatible targeted builds.fullruns all-file hooks, all-system evaluation, and every check for the current platform throughnix-fast-build.
The validation app constructs a filtered temporary path: flake from the
committed HEAD tree and overlays only task-owned changed paths. This isolates
unrelated worktree changes, makes new untracked Registry fragments visible to
Nix without staging them, and avoids copying ignored state such as .direnv.
None of these commands runs nh os switch, nixos-rebuild switch,
darwin-rebuild switch, home-manager switch, or another activation command.
The user performs activation separately.
Agent Skills
Read AGENTS.md first. Use the repository skills as follows:
validate-nix-changecontrols validation scope and evidence.debug-nix-failureclassifies parse, evaluation, build, test, activation-log, and runtime failures before proposing a correction.test-nixos-serviceadds apkgs.testers.runNixOSTestcheck when a build cannot prove service behavior.update-flake-inputlimits lock-file updates and validates them without activating a host.add-application-or-servicepreserves Registry ownership and delegates validation tovalidate-nix-change.
MCP and language-server setup
The development workload installs mcp-nixos, nixd, nix-fast-build, and
nix-tree.
Project-local Codex and OpenCode configuration exposes:
mcp-nixosfor current NixOS, Home Manager, nix-darwin, package, and Nix documentation queries;- GitHub's remote MCP endpoint for Codex and OpenCode in read-only mode, restricted to repository, pull-request, and Actions toolsets.
Set GITHUB_PERSONAL_ACCESS_TOKEN in the launching environment when GitHub MCP
access is needed. Do not commit the token or put it in a Nix expression because
that would expose it through source control or the Nix store.
The workspace VS Code settings use nixd and expose option sets for the
galleria NixOS configuration, its integrated Home Manager configuration, the
m2 nix-darwin configuration, and its integrated Home Manager configuration.