16 src = fetchFromGitHub {
17 owner = "zricethezav";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-1MCSGFpjYD4XdES+kJTz/NTN/B00TWMQ1Rmk/nsKf2Q=";
23 vendorHash = "sha256-iIgS0fXdiVMYKr3FZTYlCSEqqaH9sxZh1MFry9pGET8=";
28 "-X=github.com/zricethezav/gitleaks/v${lib.versions.major version}/cmd.Version=${version}"
31 nativeBuildInputs = [ installShellFiles ];
33 # With v8 the config tests are blocking
36 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
37 installShellCompletion --cmd ${pname} \
38 --bash <($out/bin/${pname} completion bash) \
39 --fish <($out/bin/${pname} completion fish) \
40 --zsh <($out/bin/${pname} completion zsh)
43 passthru.tests.version = testers.testVersion {
45 command = "${pname} version";
48 passthru.updateScript = nix-update-script { };
51 description = "Scan git repos (or files) for secrets";
53 Gitleaks is a SAST tool for detecting hardcoded secrets like passwords,
54 API keys and tokens in git repos.
56 homepage = "https://github.com/zricethezav/gitleaks";
57 changelog = "https://github.com/zricethezav/gitleaks/releases/tag/v${version}";
58 license = with licenses; [ mit ];
59 maintainers = with maintainers; [ fab ];
60 mainProgram = "gitleaks";