15 src = fetchFromGitHub {
16 owner = "zricethezav";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-oIhA1+gicNXDHzpdVzFeDvJHGCrqBhwyV+KOyYwMaK8=";
22 vendorHash = "sha256-4bGpTMmQmsJQ2RNIehYe0xAwwGOh2l6FGsKdciEVLAc=";
27 "-X=github.com/zricethezav/gitleaks/v${lib.versions.major version}/cmd.Version=${version}"
30 nativeBuildInputs = [ installShellFiles ];
32 # With v8 the config tests are blocking
35 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
36 installShellCompletion --cmd ${pname} \
37 --bash <($out/bin/${pname} completion bash) \
38 --fish <($out/bin/${pname} completion fish) \
39 --zsh <($out/bin/${pname} completion zsh)
42 passthru.tests.version = testers.testVersion {
44 command = "${pname} version";
48 description = "Scan git repos (or files) for secrets";
50 Gitleaks is a SAST tool for detecting hardcoded secrets like passwords,
51 API keys and tokens in git repos.
53 homepage = "https://github.com/zricethezav/gitleaks";
54 changelog = "https://github.com/zricethezav/gitleaks/releases/tag/v${version}";
55 license = with licenses; [ mit ];
56 maintainers = with maintainers; [ fab ];
57 mainProgram = "gitleaks";