From 5dc74ce5692a0256d4f2b08bcbbb66b5b0300c1d Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sat, 27 Sep 2025 19:01:57 +0900 Subject: [PATCH] gemini-cli-bin: add installCheckPhase The original check on `gemini mcp list` output was simplified as suggested by the co-author to check the `gemini -v` exit code instead. Co-authored-by: ljxfstorm --- pkgs/by-name/ge/gemini-cli-bin/package.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/by-name/ge/gemini-cli-bin/package.nix b/pkgs/by-name/ge/gemini-cli-bin/package.nix index 272b96432518..f31770f73130 100644 --- a/pkgs/by-name/ge/gemini-cli-bin/package.nix +++ b/pkgs/by-name/ge/gemini-cli-bin/package.nix @@ -3,6 +3,7 @@ stdenvNoCC, fetchurl, nodejs, + writableTmpDirAsHomeHook, nix-update-script, }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -17,6 +18,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { phases = [ "installPhase" "fixupPhase" + "installCheckPhase" ]; strictDeps = true; @@ -31,6 +33,19 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; + doInstallCheck = true; + nativeInstallCheckInputs = [ + writableTmpDirAsHomeHook + ]; + # versionCheckHook cannot be used because the reported version might be incorrect (e.g., 0.6.1 returns 0.6.0). + installCheckPhase = '' + runHook preInstallCheck + + "$out/bin/gemini" -v + + runHook postInstallCheck + ''; + passthru.updateScript = nix-update-script { # Ignore `preview` and `nightly` tags extraArgs = [ "--version-regex=^v([0-9.]+)$" ];