nixpkgs/pkgs/tools/security/gitleaks/default.nix

39 lines
933 B
Nix
Raw Normal View History

2021-03-01 23:30:56 +01:00
{ lib
, buildGoModule
2021-01-19 21:56:03 +01:00
, fetchFromGitHub
}:
buildGoModule rec {
pname = "gitleaks";
2021-12-22 22:41:56 +01:00
version = "8.2.4";
2021-01-19 21:56:03 +01:00
src = fetchFromGitHub {
owner = "zricethezav";
repo = pname;
rev = "v${version}";
2021-12-22 22:41:56 +01:00
sha256 = "sha256-74qNVW4NUGK16rZ3S7vxJ9Akci6ARcf4So1MydZVY3s=";
2021-01-19 21:56:03 +01:00
};
2021-12-19 18:54:19 +01:00
vendorSha256 = "sha256-cIwte59AdVOWMBUWE4gKZSHhU37HgEW4k0v+jUUyj1Q=";
2021-01-19 21:56:03 +01:00
2021-08-21 10:23:50 +02:00
ldflags = [
2021-12-19 18:54:19 +01:00
"-s"
"-w"
"-X github.com/zricethezav/gitleaks/v${lib.versions.major version}/version.Version=${version}"
2021-08-21 10:23:50 +02:00
];
2021-12-19 18:54:19 +01:00
# With v8 the config tests are are blocking
doCheck = false;
2021-01-19 21:56:03 +01:00
meta = with lib; {
description = "Scan git repos (or files) for secrets";
longDescription = ''
Gitleaks is a SAST tool for detecting hardcoded secrets like passwords,
2021-12-19 18:54:19 +01:00
API keys and tokens in git repos.
2021-01-19 21:56:03 +01:00
'';
homepage = "https://github.com/zricethezav/gitleaks";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}