From 94f3b464eee40b0119b8a673cd2ab8c4b4981683 Mon Sep 17 00:00:00 2001 From: "Bryan A. S" Date: Thu, 28 Jul 2022 05:04:49 -0300 Subject: [PATCH] k6: 0.38.3 -> 0.39.0 - drop explict docheck - add shell completion for bash,fish and zsh - preserve cross compilation for shell files --- pkgs/development/tools/k6/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/k6/default.nix b/pkgs/development/tools/k6/default.nix index 200eaa2cb577..cc9dcc62d349 100644 --- a/pkgs/development/tools/k6/default.nix +++ b/pkgs/development/tools/k6/default.nix @@ -1,26 +1,34 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }: buildGoModule rec { pname = "k6"; - version = "0.38.3"; + version = "0.39.0"; src = fetchFromGitHub { owner = "grafana"; repo = pname; rev = "v${version}"; - sha256 = "sha256-MV5GbsXVvq99tI5LCK6VgcXRtNUfffoz3FopwPljhdA="; + sha256 = "sha256-fphhXbaK5wNhBaP8+d4Ktqf4G8OyX/1SLiHVF+jlUF0="; }; subPackages = [ "./" ]; vendorSha256 = null; - doCheck = true; + nativeBuildInputs = [ installShellFiles ]; + doInstallCheck = true; installCheckPhase = '' $out/bin/k6 version | grep ${version} > /dev/null ''; + postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + installShellCompletion --cmd k6 \ + --bash <($out/bin/k6 completion bash) \ + --fish <($out/bin/k6 completion fish) \ + --zsh <($out/bin/k6 completion zsh) + ''; + meta = with lib; { description = "A modern load testing tool, using Go and JavaScript"; homepage = "https://k6.io/";