diff --git a/pkgs/tools/security/trufflehog/default.nix b/pkgs/tools/security/trufflehog/default.nix index 6828fa3d2e70..dc955510de00 100644 --- a/pkgs/tools/security/trufflehog/default.nix +++ b/pkgs/tools/security/trufflehog/default.nix @@ -1,6 +1,8 @@ { lib , fetchFromGitHub , buildGoModule +, testers +, trufflehog }: buildGoModule rec { @@ -16,6 +18,12 @@ buildGoModule rec { vendorHash = "sha256-sSpRu6zLIvllrDYdtrj3oD3pCVs9ucSXbu3IYTqjT+k="; + ldflags = [ + "-s" + "-w" + "-X=github.com/trufflesecurity/trufflehog/v3/pkg/version.BuildVersion=${version}" + ]; + # Test cases run git clone and require network access doCheck = false; @@ -23,6 +31,12 @@ buildGoModule rec { rm $out/bin/{generate,snifftest} ''; + passthru = { + tests.version = testers.testVersion { + package = trufflehog; + }; + }; + meta = with lib; { description = "Find credentials all over the place"; homepage = "https://github.com/trufflesecurity/trufflehog";