mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-17 06:04:55 +00:00
pi-agent stack
This commit is contained in:
parent
e19ee2405e
commit
345c38bfc9
4 changed files with 125 additions and 0 deletions
|
|
@ -21,6 +21,7 @@
|
|||
./mise.nix
|
||||
./migration.nix
|
||||
./nvim.nix
|
||||
./pi.nix
|
||||
./prompt.nix
|
||||
./skills.nix
|
||||
./scripts.nix
|
||||
|
|
|
|||
47
home/pi.nix
Normal file
47
home/pi.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
hostConfig,
|
||||
...
|
||||
}:
|
||||
lib.mkIf hostConfig.isLinux {
|
||||
# Install pi-coding-agent globally via npm at activation time.
|
||||
home.activation.installPiAgent = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
export PATH="${
|
||||
lib.makeBinPath [
|
||||
pkgs.nodejs_22
|
||||
pkgs.coreutils
|
||||
]
|
||||
}:$PATH"
|
||||
|
||||
npm_prefix="$(npm prefix -g 2>/dev/null)"
|
||||
pkg_dir="$npm_prefix/lib/node_modules/@mariozechner/pi-coding-agent"
|
||||
|
||||
if [ ! -d "$pkg_dir" ]; then
|
||||
npm install -g @mariozechner/pi-coding-agent 2>/dev/null || true
|
||||
fi
|
||||
'';
|
||||
|
||||
# Install Pi extensions at activation time:
|
||||
# - @e9n/pi-channels: Telegram/Slack bridge with RPC-based persistent sessions
|
||||
# - pi-schedule-prompt: cron/interval scheduled prompts
|
||||
# - pi-subagents: background task delegation with async execution
|
||||
home.activation.installPiExtensions = lib.hm.dag.entryAfter [ "installPiAgent" ] ''
|
||||
export PATH="${
|
||||
lib.makeBinPath [
|
||||
pkgs.nodejs_22
|
||||
pkgs.coreutils
|
||||
pkgs.git
|
||||
]
|
||||
}:$PATH"
|
||||
|
||||
npm_prefix="$(npm prefix -g 2>/dev/null)"
|
||||
pi_bin="$npm_prefix/bin/pi"
|
||||
|
||||
if [ -x "$pi_bin" ]; then
|
||||
for pkg in "@e9n/pi-channels" "pi-schedule-prompt" "pi-subagents"; do
|
||||
"$pi_bin" install "npm:$pkg" 2>/dev/null || true
|
||||
done
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue