nixpkgs/pkgs/tools/security/trufflehog/default.nix
2024-04-24 02:50:20 +00:00

49 lines
1.1 KiB
Nix

{
lib,
fetchFromGitHub,
buildGoModule,
testers,
trufflehog,
}:
buildGoModule rec {
pname = "trufflehog";
version = "3.74.0";
src = fetchFromGitHub {
owner = "trufflesecurity";
repo = "trufflehog";
rev = "refs/tags/v${version}";
hash = "sha256-smG27WHWGe15Q0XIjeK4C45mEvJuYqsUf0SsaMyYGzs=";
};
vendorHash = "sha256-FOFrFmILeONJyKGZ7I+sWd8Di0Ni6P5/buA5QbR41A4=";
proxyVendor = true;
ldflags = [
"-s"
"-w"
"-X=github.com/trufflesecurity/trufflehog/v3/pkg/version.BuildVersion=${version}"
];
# Test cases run git clone and require network access
doCheck = false;
postInstall = ''
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";
changelog = "https://github.com/trufflesecurity/trufflehog/releases/tag/v${version}";
license = with licenses; [ agpl3Only ];
maintainers = with maintainers; [ fab ];
};
}