From a693ec73036cfe4c3aafb49bebd4480bcc1bc9ab Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 27 Sep 2026 05:40:09 +0530 Subject: feat(development/pi-coding-agent): added the submodule, CONTEXT.md and prompts --- modules/development/pi-coding-agent/default.nix | 112 ++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 modules/development/pi-coding-agent/default.nix (limited to 'modules/development/pi-coding-agent/default.nix') diff --git a/modules/development/pi-coding-agent/default.nix b/modules/development/pi-coding-agent/default.nix new file mode 100644 index 0000000..1b27012 --- /dev/null +++ b/modules/development/pi-coding-agent/default.nix @@ -0,0 +1,112 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.development.pi-coding-agent; + configDir = "${config.xdg.configHome}/pi"; +in +{ + options.development.pi-coding-agent = { + enable = lib.mkEnableOption "Pi Coding Agent"; + + package = lib.mkOption { + type = lib.types.package; + default = pkgs.pi; + description = "The Pi Coding Agent package to use."; + }; + }; + + config = lib.mkIf cfg.enable { + home.sessionVariables = { + PI_CODING_AGENT_DIR = configDir; + }; + + home.file = { + "${configDir}/skills".source = ./skills; + "${configDir}/prompts".source = ./prompts; + "${configDir}/agents".source = ./agents; + }; + + programs.pi-coding-agent = { + enable = true; + inherit configDir; + keybindings = { + "tui.editor.cursorUp" = [ + "up" + "ctrl+p" + ]; + + "tui.editor.cursorDown" = [ + "down" + "ctrl+n" + ]; + + "tui.editor.deleteWordBackward" = [ + "ctrl+w" + "alt+backspace" + ]; + + "tui.editor.historyPrevious" = "ctrl+up"; + }; + + settings = { + defaultTools = [ + "read" + "bash" + "edit" + "write" + "grep" + "find" + "ls" + ]; + + defaultProjectTrust = "ask"; + + compaction = { + enabled = true; + reserveTokens = 16384; + keepRecentTokens = 20000; + }; + + retry = { + enabled = true; + maxRetries = 3; + baseDelayMs = 2000; + maxAgentDelayMs = 60000; + }; + + theme = "dark"; + + packages = [ + "npm:@termdraw/pi" + "npm:pi-mcp-adapter" + "npm:@henryqw/pi-subagent" + ]; + + skills = [ + "${configDir}/skills" + ]; + + prompts = [ + "${configDir}/prompts" + ]; + + themes = [ + "${configDir}/themes" + ]; + + enableSkillCommands = true; + + context = ./CONTEXT.md; + }; + + extraPackages = with pkgs; [ + nodejs + bun + ]; + }; + }; +} -- cgit v1.2.3