diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 43ff0018714f..f06d2136b8c6 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -613,7 +613,7 @@ rec { command ? "${package.meta.mainProgram or package.pname or package.name} --version", version ? package.version, }: runCommand "test-version" { nativeBuildInputs = [ package ]; meta.timeout = 60; } '' - ${command} | grep -Fw ${version} + ${command} |& grep -Fw ${version} touch $out ''; } diff --git a/pkgs/development/tools/buf/default.nix b/pkgs/development/tools/buf/default.nix index 84979df92c24..1b9763feb00a 100644 --- a/pkgs/development/tools/buf/default.nix +++ b/pkgs/development/tools/buf/default.nix @@ -3,6 +3,8 @@ , fetchFromGitHub , protobuf , git +, testVersion +, buf }: buildGoModule rec { @@ -54,13 +56,7 @@ buildGoModule rec { runHook postInstall ''; - doInstallCheck = true; - installCheckPhase = '' - runHook preInstallCheck - $out/bin/buf --help - $out/bin/buf --version 2>&1 | grep "${version}" - runHook postInstallCheck - ''; + passthru.tests.version = testVersion { package = buf; }; meta = with lib; { homepage = "https://buf.build";