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.]+)$" ];