fix(coding-agent): append Node to PATH in the Nix wrapper

Shells started by the bash tool now keep the user's node/npm. Pi still
runs on the pinned Node, which stays available as an npm fallback.

closes #10519
This commit is contained in:
Armin Ronacher 2026-10-15 15:49:34 +02:00
parent a3f265b1c6
commit eddebaeebf
2 changed files with 6 additions and 1 deletions

View file

@ -118,12 +118,16 @@ stdenv.mkDerivation {
mkdir -p "$out/lib/pi" "$out/bin"
cp -R . "$out/lib/pi"
# The wrapper runs Pi with an absolute Node path. Node is only on PATH so Pi can
# find npm for package installs; append it so that shells started by the
# bash tool keep the user's node/npm (e.g. from mise or nvm). fd, ripgrep,
# and the clipboard tools are Pi's own dependencies and take precedence.
makeWrapper ${nodejs}/bin/node "$out/bin/pi" \
--add-flags "$out/lib/pi/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli.js" \
--suffix PATH : ${lib.makeBinPath [ nodejs ]} \
--prefix PATH : ${
lib.makeBinPath (
[
nodejs
fd
ripgrep
]