Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }: 2 3buildGoModule rec { 4 pname = "k6"; 5 version = "0.44.1"; 6 7 src = fetchFromGitHub { 8 owner = "grafana"; 9 repo = pname; 10 rev = "v${version}"; 11 sha256 = "sha256-BfzB6Qt0Hg9ryU4zeTi40jByOgqr9mveq5ZGkO8bA9U="; 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 ]; 38 }; 39}