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.
29 lines
714 B
Nix
29 lines
714 B
Nix
{
|
|
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";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home-manager.users.${user}.programs.pi-coding-agent = {
|
|
enable = true;
|
|
|
|
settings = {
|
|
defaultProvider = "anthropic";
|
|
# Pi's catalogue id for Opus.
|
|
defaultModel = "claude-opus-4-8";
|
|
enableAnalytics = false;
|
|
};
|
|
};
|
|
};
|
|
}
|