b5f92a349c
GitOrigin-RevId: 7c9cc5a6e5d38010801741ac830a3f8fd667a7a0
39 lines
1 KiB
Nix
39 lines
1 KiB
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "k6";
|
|
version = "0.47.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "grafana";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-90r6dyesYfa/eC/joUDPDfGU8r8qbPzzhwf0EwnGee0=";
|
|
};
|
|
|
|
subPackages = [ "./" ];
|
|
|
|
vendorHash = null;
|
|
|
|
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/";
|
|
changelog = "https://github.com/grafana/k6/releases/tag/v${version}";
|
|
license = licenses.agpl3Plus;
|
|
maintainers = with maintainers; [ offline bryanasdev000 kashw2 ];
|
|
};
|
|
}
|