Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildGoModule 3, fetchFromGitHub 4, gotestwaf 5, testers 6}: 7 8buildGoModule rec { 9 pname = "gotestwaf"; 10 version = "0.4.0"; 11 12 src = fetchFromGitHub { 13 owner = "wallarm"; 14 repo = pname; 15 rev = "v${version}"; 16 hash = "sha256-waYX7DMyLW0eSzpFRyiCJQdYLFGaAKSlvGYrdcRfCl4="; 17 }; 18 19 vendorHash = null; 20 21 # Some tests require networking as of v0.4.0 22 doCheck = false; 23 24 ldflags = [ 25 "-X github.com/wallarm/gotestwaf/internal/version.Version=v${version}" 26 ]; 27 28 postFixup = '' 29 # Rename binary 30 mv $out/bin/cmd $out/bin/${pname} 31 ''; 32 33 passthru.tests.version = testers.testVersion { 34 command = "gotestwaf --version"; 35 package = gotestwaf; 36 version = "v${version}"; 37 }; 38 39 meta = with lib; { 40 description = "Tool for API and OWASP attack simulation"; 41 homepage = "https://github.com/wallarm/gotestwaf"; 42 license = licenses.mit; 43 maintainers = with maintainers; [ fab ]; 44 }; 45}