Add a `pi` module that turns on the home-manager `programs.pi-coding-agent` integration for the primary user and freezes a single settings.json: the default provider set to Anthropic, the default model to Opus (claude-opus-4-8, Pi's own catalogue id), and analytics disabled. Everything else in ~/.pi/agent — the credential and all self-modification state — is left unmanaged, so login survives rebuilds and backing Pi out is a one-line enable flip. Enabled on neogaia alone.
3.6 KiB
spec
| spec |
|---|
| pi-coding-agent |
What to build
Add a pi module, auto-discovered like every other feature and inert until a host enables it, that installs Pi for the primary user through the home-manager programs.pi-coding-agent module.
On enable it freezes exactly one file — settings.json — pinning the default provider to Anthropic and the default model to Opus (the exact model-id string confirmed against Pi's own model catalogue), and disabling analytics.
Everything else — agent context, skills, extensions, keybindings, custom providers — is left at its default, so home-manager renders nothing but settings.json and Pi owns the rest of ~/.pi/agent/.
Pi authenticates by reusing the existing Claude subscription, and that credential is left unmanaged by the flake so no secret enters the repo and re-auth survives rebuilds, mirroring how the claude-code module treats its login.
Lay the module out as a directory (not a single file), and enable it on neogaia alone with a single enable = true.
Acceptance criteria
- A
pimodule exists as its own directory, declares a singleenableoption under themodulestree, guards its body with the Enable convention, and stays inert until a host enables it. - On enable, the module turns on
programs.pi-coding-agentfor the primary user from the base package set, with no other host affected. - The frozen
settings.jsonsets the default provider to Anthropic, the default model to Opus (exact model-id verified against Pi's catalogue), and disables analytics — and no other upstream option (context,models,keybindings,extraPackages,configDir) is set. - Pi's credential and all of its writable state (
~/.pi/agent/beyondsettings.json) are left unmanaged by the flake. neogaiaenables the module with a singleenable = trueand its system toplevel still builds vianix flake check(thechecks.x86_64-linux.neogaiatarget).- Disabling the module is a one-line
enableflip that leaves no flake-managed residue.
Implementation Notes
- Model-id and analytics key confirmed against Pi 0.80.7 at build time. The
pi-coding-agentpackage pins0.80.7; itsdist/core/model-resolver.jsdefaults theanthropicprovider toclaude-opus-4-8, which is the Opus id used. The analytics key isenableAnalytics(boolean, defaultfalse), per the package's owndocs/settings.md. Both were read from the built store path, not guessed. - Verified through the primary seam.
config.modules.pi.enableandprograms.pi-coding-agent.enableboth evaluatetrueonneogaia; the renderedsettings.jsonis exactly{"defaultModel":"claude-opus-4-8","defaultProvider":"anthropic","enableAnalytics":false}; only one file (settings.json) is rendered under~/.pi/agent; andchecks.x86_64-linux.neogaiabuilds green withpi-coding-agent-0.80.7included. - No deviations from the spec. The diff is the module plus one
enable = trueline — every "Out of Scope" item (agent context/AGENTS.md, skills, extensions, keybindings, custom providers, Pi-specific sudo guard) is left out. - Review follow-through.
/review-uncommittedrated Risk Low and Spec clean. Standards flagged four comment-convention issues on the new module (a semicolon in a comment, an overloaded file-top header duplicating the inline rationale, and a cross-file clause on the model-id comment); all were fixed in the diff, so the header is now a two-sentence purpose line mirroring the siblingclaude-codemodule and the frozen-settings rationale lives only at its inline site. No findings left unaddressed.