2022-07-28 08:04:49 +00:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2019-02-16 12:20:34 +00:00
|
|
|
|
2021-12-06 21:41:26 +00:00
|
|
|
buildGoModule rec {
|
2019-03-20 11:42:13 +00:00
|
|
|
pname = "k6";
|
2024-08-13 14:48:17 +00:00
|
|
|
version = "0.53.0";
|
2019-02-16 12:20:34 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-06 21:41:26 +00:00
|
|
|
owner = "grafana";
|
2019-03-20 11:42:13 +00:00
|
|
|
repo = pname;
|
2019-02-16 12:20:34 +00:00
|
|
|
rev = "v${version}";
|
2024-08-13 14:48:17 +00:00
|
|
|
hash = "sha256-mh7Y7AGNvXRD2MJN8UOCSDNWJZlnu9hBdeDePfce9g8=";
|
2019-02-16 12:20:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
subPackages = [ "./" ];
|
|
|
|
|
2023-04-20 18:09:49 +00:00
|
|
|
vendorHash = null;
|
2021-12-06 21:41:26 +00:00
|
|
|
|
2022-07-28 08:04:49 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-12-06 21:41:26 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/k6 version | grep ${version} > /dev/null
|
|
|
|
'';
|
|
|
|
|
2022-07-28 08:04:49 +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-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2019-02-16 12:20:34 +00:00
|
|
|
description = "Modern load testing tool, using Go and JavaScript";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "k6";
|
2020-05-24 17:06:23 +00:00
|
|
|
homepage = "https://k6.io/";
|
2021-12-06 21:41:26 +00:00
|
|
|
changelog = "https://github.com/grafana/k6/releases/tag/v${version}";
|
2019-02-16 12:20:34 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2023-08-31 03:18:39 +00:00
|
|
|
maintainers = with maintainers; [ offline bryanasdev000 kashw2 ];
|
2019-02-16 12:20:34 +00:00
|
|
|
};
|
|
|
|
}
|