feat(pi): install the coding agent for a side-by-side trial (task 0020)

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.
This commit is contained in:
2026-07-21 19:29:15 -04:00
parent 6f34c95c51
commit 946c7a92a6
4 changed files with 141 additions and 0 deletions

37
modules/pi/pi.nix Normal file
View File

@@ -0,0 +1,37 @@
{
config,
lib,
...
}:
# Pi, a terminal coding agent, for the primary user, configured through
# home-manager, which ships the package and manages ~/.pi/agent.
# The login credential is left unmanaged, so it survives rebuilds.
let
cfg = config.modules.pi;
user = config.user.name;
in
{
options.modules.pi.enable = lib.mkEnableOption ''
Pi, a terminal coding agent, configured via home-manager.
Pins the provider to Anthropic and the model to Opus so Pi runs the same
model as Claude Code, and disables analytics. Authentication reuses an
existing Claude subscription and is deliberately left unmanaged, so no
credential enters the repo and re-auth survives rebuilds'';
config = lib.mkIf cfg.enable {
home-manager.users.${user}.programs.pi-coding-agent = {
enable = true;
# settings.json is the only file here Pi writes at runtime, and only its
# analytics keys. Disabling analytics removes that write, so freezing the
# file never fights Pi's self-modification, which targets other paths.
settings = {
defaultProvider = "anthropic";
# Pi's catalogue id for Opus.
defaultModel = "claude-opus-4-8";
enableAnalytics = false;
};
};
};
}