gemini-cli: fix ripgrep path

Previously, this package relied on `ensureRgPath()` to locate a bundled
`ripgrep` binary. This caused runtime failures in the `SearchText` tool
on NixOS (specifically observed on aarch64-linux), as the bundled binary is
dynamically linked and lacks required libraries.

This change substitutes `gemini-cli`'s internal binary resolution (`ensureRgPath()`) with the absolute path to `ripgrep`'s binary in the Nix store .
This commit is contained in:
Sinclair Mosley
2026-01-09 16:35:11 +11:00
committed by Sinclair Mosley
parent 2d6af14561
commit 6c1a7d4d0a
+4
View File
@@ -50,6 +50,10 @@ buildNpmPackage (finalAttrs: {
# Remove node-pty dependency from packages/core/package.json
${jq}/bin/jq 'del(.optionalDependencies."node-pty")' packages/core/package.json > packages/core/package.json.tmp && mv packages/core/package.json.tmp packages/core/package.json
# Fix ripgrep path for SearchText; ensureRgPath() on its own may return the path to a dynamically-linked ripgrep binary without required libraries
substituteInPlace packages/core/src/tools/ripGrep.ts \
--replace-fail "await ensureRgPath();" "'${lib.getExe ripgrep}';"
# Ideal method to disable auto-update
sed -i '/disableAutoUpdate: {/,/}/ s/default: false/default: true/' packages/cli/src/config/settingsSchema.ts