gemini-cli-bin: use ripgrep from nixpkgs

Co-authored-by: Sinclair Mosley <sinclairjmosley@outlook.com>
This commit is contained in:
ljxfstorm
2026-01-19 16:40:14 +08:00
co-authored by Sinclair Mosley
parent 0311983f85
commit 3ef7239ed3
+11 -1
View File
@@ -6,6 +6,7 @@
sysctl,
writableTmpDirAsHomeHook,
nix-update-script,
ripgrep,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "gemini-cli-bin";
@@ -20,7 +21,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
strictDeps = true;
buildInputs = [ nodejs ];
buildInputs = [
nodejs
ripgrep
];
installPhase = ''
runHook preInstall
@@ -37,6 +41,12 @@ stdenvNoCC.mkDerivation (finalAttrs: {
--replace-fail "settings.merged.general?.disableAutoUpdate ?? false" "settings.merged.general?.disableAutoUpdate ?? true" \
--replace-fail "settings.merged.general?.disableAutoUpdate" "(settings.merged.general?.disableAutoUpdate ?? true)"
# use `ripgrep` from `nixpkgs`, more dependencies but prevent downloading incompatible binary on NixOS
# this workaround can be removed once the following upstream issue is resolved:
# https://github.com/google-gemini/gemini-cli/issues/11438
substituteInPlace $out/bin/gemini \
--replace-fail 'const existingPath = await resolveExistingRgPath();' 'const existingPath = "${lib.getExe ripgrep}";'
runHook postInstall
'';