fix agent-browser PATH: add npm global bin to zsh path

- Add npm global bin dir to zsh path array so agent-browser
  (and other npm -g binaries) are found in interactive shells
- Fix activation check to look for the binary at the actual npm
  prefix path instead of relying on command -v with wrong PATH
This commit is contained in:
Harivansh Rathi 2026-04-02 00:11:18 -04:00
parent 92b13153e9
commit 8cf74b95be
2 changed files with 3 additions and 1 deletions

View file

@ -21,7 +21,8 @@ lib.mkIf (!hostConfig.isDarwin) {
]
}:$PATH"
if ! command -v agent-browser >/dev/null 2>&1; then
npm_bin="$(npm prefix -g 2>/dev/null)/bin"
if [ ! -x "$npm_bin/agent-browser" ]; then
npm install -g agent-browser 2>/dev/null || true
fi
'';

View file

@ -83,6 +83,7 @@
"$BUN_INSTALL/bin"
"$HOME/.antigravity/antigravity/bin"
"$HOME/.opencode/bin"
"$(npm prefix -g 2>/dev/null)/bin"
"${pkgs.postgresql_17}/bin"
"$HOME/.nix-profile/bin"
"/run/wrappers/bin"