57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
buildGoModule,
|
|
versionCheckHook,
|
|
makeWrapper,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "trufflehog";
|
|
version = "3.88.15";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "trufflesecurity";
|
|
repo = "trufflehog";
|
|
tag = "v${version}";
|
|
hash = "sha256-x50MXESTVTIJ+pMfGQkcdtytJCFP3EOdYp8lSdKE9Rg=";
|
|
};
|
|
|
|
vendorHash = "sha256-+PH5n+6d3egvJSFJhM4g9AYR7JM0SbDpSe/t9OjqtH4=";
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
proxyVendor = true;
|
|
|
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
|
|
|
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}
|
|
|
|
wrapProgram $out/bin/trufflehog --add-flags --no-update
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
|
|
versionCheckProgramArg = [ "--version" ];
|
|
|
|
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
|
|
sarcasticadmin
|
|
];
|
|
};
|
|
}
|