mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
pi-coding-agent: add module
This commit is contained in:
committed by
Austin Horstman
parent
5fadbec07a
commit
37e8eef933
9
tests/modules/programs/pi-coding-agent/context-empty.nix
Normal file
9
tests/modules/programs/pi-coding-agent/context-empty.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
context = "";
|
||||
};
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.pi/agent/AGENTS.md
|
||||
'';
|
||||
}
|
||||
4
tests/modules/programs/pi-coding-agent/context-inline.md
Normal file
4
tests/modules/programs/pi-coding-agent/context-inline.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Global Pi Context
|
||||
|
||||
Always use TypeScript strict mode.
|
||||
Follow the project's existing code style.
|
||||
16
tests/modules/programs/pi-coding-agent/context-inline.nix
Normal file
16
tests/modules/programs/pi-coding-agent/context-inline.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
context = ''
|
||||
# Global Pi Context
|
||||
|
||||
Always use TypeScript strict mode.
|
||||
Follow the project's existing code style.
|
||||
'';
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.pi/agent/AGENTS.md
|
||||
assertFileContent home-files/.pi/agent/AGENTS.md \
|
||||
${./context-inline.md}
|
||||
'';
|
||||
}
|
||||
11
tests/modules/programs/pi-coding-agent/context-path.nix
Normal file
11
tests/modules/programs/pi-coding-agent/context-path.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
context = ./context-inline.md;
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.pi/agent/AGENTS.md
|
||||
assertFileContent home-files/.pi/agent/AGENTS.md \
|
||||
${./context-inline.md}
|
||||
'';
|
||||
}
|
||||
11
tests/modules/programs/pi-coding-agent/custom-config-dir.nix
Normal file
11
tests/modules/programs/pi-coding-agent/custom-config-dir.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
configDir = "/home/testuser/.config/pi/agent";
|
||||
};
|
||||
nmt.script = ''
|
||||
# Verify env var is set for non-default configDir
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'PI_CODING_AGENT_DIR'
|
||||
'';
|
||||
}
|
||||
10
tests/modules/programs/pi-coding-agent/default.nix
Normal file
10
tests/modules/programs/pi-coding-agent/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
pi-coding-agent-settings = ./settings.nix;
|
||||
pi-coding-agent-empty-settings = ./empty-settings.nix;
|
||||
pi-coding-agent-keybindings = ./keybindings.nix;
|
||||
pi-coding-agent-context-inline = ./context-inline.nix;
|
||||
pi-coding-agent-context-path = ./context-path.nix;
|
||||
pi-coding-agent-context-empty = ./context-empty.nix;
|
||||
pi-coding-agent-custom-config-dir = ./custom-config-dir.nix;
|
||||
pi-coding-agent-models = ./models.nix;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
settings = { };
|
||||
};
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.pi/agent/settings.json
|
||||
'';
|
||||
}
|
||||
14
tests/modules/programs/pi-coding-agent/keybindings.json
Normal file
14
tests/modules/programs/pi-coding-agent/keybindings.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"tui.editor.cursorDown": [
|
||||
"down",
|
||||
"ctrl+n"
|
||||
],
|
||||
"tui.editor.cursorUp": [
|
||||
"up",
|
||||
"ctrl+p"
|
||||
],
|
||||
"tui.editor.deleteWordBackward": [
|
||||
"ctrl+w",
|
||||
"alt+backspace"
|
||||
]
|
||||
}
|
||||
24
tests/modules/programs/pi-coding-agent/keybindings.nix
Normal file
24
tests/modules/programs/pi-coding-agent/keybindings.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
keybindings = {
|
||||
"tui.editor.cursorUp" = [
|
||||
"up"
|
||||
"ctrl+p"
|
||||
];
|
||||
"tui.editor.cursorDown" = [
|
||||
"down"
|
||||
"ctrl+n"
|
||||
];
|
||||
"tui.editor.deleteWordBackward" = [
|
||||
"ctrl+w"
|
||||
"alt+backspace"
|
||||
];
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.pi/agent/keybindings.json
|
||||
assertFileContent home-files/.pi/agent/keybindings.json \
|
||||
${./keybindings.json}
|
||||
'';
|
||||
}
|
||||
14
tests/modules/programs/pi-coding-agent/models.json
Normal file
14
tests/modules/programs/pi-coding-agent/models.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"providers": {
|
||||
"litellm": {
|
||||
"api": "openai-completions",
|
||||
"apiKey": "ollama",
|
||||
"baseUrl": "http://localhost:11434/v1",
|
||||
"models": [
|
||||
{
|
||||
"id": "llama3.1:8b"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
20
tests/modules/programs/pi-coding-agent/models.nix
Normal file
20
tests/modules/programs/pi-coding-agent/models.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
models = {
|
||||
providers = {
|
||||
litellm = {
|
||||
baseUrl = "http://localhost:11434/v1";
|
||||
api = "openai-completions";
|
||||
apiKey = "ollama";
|
||||
models = [ { id = "llama3.1:8b"; } ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.pi/agent/models.json
|
||||
assertFileContent home-files/.pi/agent/models.json \
|
||||
${./models.json}
|
||||
'';
|
||||
}
|
||||
19
tests/modules/programs/pi-coding-agent/settings.json
Normal file
19
tests/modules/programs/pi-coding-agent/settings.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compaction": {
|
||||
"enabled": true,
|
||||
"keepRecentTokens": 20000,
|
||||
"reserveTokens": 16384
|
||||
},
|
||||
"defaultModel": "claude-sonnet-4-20250514",
|
||||
"defaultProvider": "anthropic",
|
||||
"defaultThinkingLevel": "medium",
|
||||
"enabledModels": [
|
||||
"claude-*",
|
||||
"gpt-4o"
|
||||
],
|
||||
"retry": {
|
||||
"enabled": true,
|
||||
"maxRetries": 3
|
||||
},
|
||||
"theme": "dark"
|
||||
}
|
||||
29
tests/modules/programs/pi-coding-agent/settings.nix
Normal file
29
tests/modules/programs/pi-coding-agent/settings.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
settings = {
|
||||
defaultProvider = "anthropic";
|
||||
defaultModel = "claude-sonnet-4-20250514";
|
||||
defaultThinkingLevel = "medium";
|
||||
theme = "dark";
|
||||
compaction = {
|
||||
enabled = true;
|
||||
reserveTokens = 16384;
|
||||
keepRecentTokens = 20000;
|
||||
};
|
||||
retry = {
|
||||
enabled = true;
|
||||
maxRetries = 3;
|
||||
};
|
||||
enabledModels = [
|
||||
"claude-*"
|
||||
"gpt-4o"
|
||||
];
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.pi/agent/settings.json
|
||||
assertFileContent home-files/.pi/agent/settings.json \
|
||||
${./settings.json}
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user