at 23.11-beta 39 lines 1.1 kB view raw
1{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }: 2 3buildGoModule rec { 4 pname = "k6"; 5 version = "0.47.0"; 6 7 src = fetchFromGitHub { 8 owner = "grafana"; 9 repo = pname; 10 rev = "v${version}"; 11 hash = "sha256-90r6dyesYfa/eC/joUDPDfGU8r8qbPzzhwf0EwnGee0="; 12 }; 13 14 subPackages = [ "./" ]; 15 16 vendorHash = null; 17 18 nativeBuildInputs = [ installShellFiles ]; 19 20 doInstallCheck = true; 21 installCheckPhase = '' 22 $out/bin/k6 version | grep ${version} > /dev/null 23 ''; 24 25 postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' 26 installShellCompletion --cmd k6 \ 27 --bash <($out/bin/k6 completion bash) \ 28 --fish <($out/bin/k6 completion fish) \ 29 --zsh <($out/bin/k6 completion zsh) 30 ''; 31 32 meta = with lib; { 33 description = "A modern load testing tool, using Go and JavaScript"; 34 homepage = "https://k6.io/"; 35 changelog = "https://github.com/grafana/k6/releases/tag/v${version}"; 36 license = licenses.agpl3Plus; 37 maintainers = with maintainers; [ offline bryanasdev000 kashw2 ]; 38 }; 39}