Commit 6c1a7d4d authored by Sinclair Mosley's avatar Sinclair Mosley Committed by Sinclair Mosley
Browse files

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 .
parent 2d6af145
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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