2022-01-10 16:49:31 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2021-01-06 18:11:00 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "grype";
|
2022-01-11 16:43:10 +00:00
|
|
|
version = "0.31.1";
|
2021-01-06 18:11:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "anchore";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-01-11 16:43:10 +00:00
|
|
|
sha256 = "sha256-3V8qBgRIogZNisUshhs9Va9cbZ5D2hBJwqXPvqSmEWw=";
|
2021-01-06 18:11:00 +00:00
|
|
|
};
|
|
|
|
|
2022-01-11 16:43:10 +00:00
|
|
|
vendorSha256 = "sha256-/Z0tRzd7v84h8TSfbT4EqwyHWpAb30VNr4EDrNlHyd4=";
|
2021-01-06 18:11:00 +00:00
|
|
|
|
2022-01-10 16:49:31 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2021-01-06 18:11:00 +00:00
|
|
|
|
2021-08-21 08:23:50 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X github.com/anchore/grype/internal/version.version=${version}"
|
|
|
|
];
|
2021-03-27 14:16:51 +00:00
|
|
|
|
|
|
|
# Tests require a running Docker instance
|
2021-01-06 18:11:00 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-01-10 16:49:31 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd grype \
|
|
|
|
--bash <($out/bin/grype completion bash) \
|
|
|
|
--fish <($out/bin/grype completion fish) \
|
|
|
|
--zsh <($out/bin/grype completion zsh)
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-01-10 16:49:31 +00:00
|
|
|
homepage = "https://github.com/anchore/grype";
|
|
|
|
changelog = "https://github.com/anchore/grype/releases/tag/v${version}";
|
2021-01-06 18:11:00 +00:00
|
|
|
description = "Vulnerability scanner for container images and filesystems";
|
|
|
|
longDescription = ''
|
2022-01-10 16:49:31 +00:00
|
|
|
As a vulnerability scanner grype is able to scan the contents of a
|
|
|
|
container image or filesystem to find known vulnerabilities.
|
2021-01-06 18:11:00 +00:00
|
|
|
'';
|
|
|
|
license = with licenses; [ asl20 ];
|
2022-01-10 16:49:31 +00:00
|
|
|
maintainers = with maintainers; [ fab jk ];
|
2021-01-06 18:11:00 +00:00
|
|
|
};
|
|
|
|
}
|