49 lines
1.3 KiB
Nix
49 lines
1.3 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
# Pi, a terminal coding agent, for the primary user, configured through
|
|
# home-manager, which ships the package and manages global settings.
|
|
# The login credential is left unmanaged, so it survives rebuilds.
|
|
let
|
|
cfg = config.modules.shell.pi;
|
|
user = config.user.name;
|
|
piDir = "${config.users.users.${user}.home}/.pi/agent";
|
|
patchedPi = pkgs.pi-coding-agent.overrideAttrs (old: {
|
|
patches = (old.patches or [ ]) ++ [
|
|
./patches/pi-flex-spacer.patch
|
|
./patches/pi-tool-lookup-validation.patch
|
|
];
|
|
});
|
|
in
|
|
{
|
|
options.modules.shell.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;
|
|
package = patchedPi;
|
|
|
|
settings = {
|
|
defaultProvider = "openai-codex";
|
|
defaultModel = "gpt-5.5";
|
|
defaultThinkingLevel = "medium";
|
|
theme = "dark";
|
|
enableInstallTelemetry = false;
|
|
enableAnalytics = false;
|
|
};
|
|
};
|
|
|
|
# The first declarative rollout replaces the interactive settings file.
|
|
# Login state stays in auth.json, which this module does not manage.
|
|
home.file."${piDir}/settings.json".force = true;
|
|
};
|
|
};
|
|
}
|