fix: npm-global PATH for codex/gemini-cli

This commit is contained in:
matiss
2026-04-20 18:32:25 +03:00
parent ac06798d82
commit f2d8e2d32a
2 changed files with 8 additions and 14 deletions

View File

@@ -73,18 +73,9 @@
dconf
];
# ── Post-activation: Install npm-only tools ────────────
# Codex and Gemini CLI aren't in nixpkgs; install them
# globally via npm after first `nixos-rebuild switch`.
home.activation.installNpmTools = config.lib.dag.entryAfter [ "writeBoundary" ] ''
export PATH="${pkgs.nodejs}/bin:$PATH"
if ! command -v codex &> /dev/null; then
echo "Installing @openai/codex via npm..."
${pkgs.nodejs}/bin/npm i -g @openai/codex 2>/dev/null || true
fi
if ! command -v gemini &> /dev/null; then
echo "Installing @google/gemini-cli via npm..."
${pkgs.nodejs}/bin/npm i -g @google/gemini-cli 2>/dev/null || true
fi
'';
# ── npm global tools (codex, gemini-cli) ────────────────
# These aren't in nixpkgs. Install once after first boot:
# mkdir -p ~/.npm-global && npm config set prefix ~/.npm-global
# npm i -g @openai/codex @google/gemini-cli
# PATH is set in shell.nix via ~/.npm-global/bin
}