2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "k6";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "0.43.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-19 01:06:50 +00:00
|
|
|
owner = "grafana";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
sha256 = "sha256-JiXVDdCbXCsOSgYXIjJwXcgsbFPPoF/bY4nftaSgtdM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
subPackages = [ "./" ];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
vendorHash = null;
|
2021-12-19 01:06:50 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/k6 version | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A modern load testing tool, using Go and JavaScript";
|
2020-05-29 06:06:01 +00:00
|
|
|
homepage = "https://k6.io/";
|
2021-12-19 01:06:50 +00:00
|
|
|
changelog = "https://github.com/grafana/k6/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2021-12-19 01:06:50 +00:00
|
|
|
maintainers = with maintainers; [ offline bryanasdev000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|