2022-12-28 21:21:41 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, testers
|
|
|
|
, osv-scanner
|
|
|
|
}:
|
2024-04-21 15:54:59 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "osv-scanner";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "1.9.0";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "osv-scanner";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-hK8hvD59X+JzeBtYqwlfNBy2XX7slzMKoIHxL8DmRGc=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
vendorHash = "sha256-IVtdZCwjGrGr0DuyPCkt5DJQhD8mN7bEFI41e0a3s8s=";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
subPackages = [
|
|
|
|
"cmd/osv-scanner"
|
|
|
|
];
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2024-04-21 15:54:59 +00:00
|
|
|
"-X=github.com/google/osv-scanner/internal/version.OSVVersion=${version}"
|
|
|
|
"-X=main.commit=n/a"
|
|
|
|
"-X=main.date=1970-01-01T00:00:00Z"
|
2022-12-28 21:21:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Tests require network connectivity to query https://api.osv.dev.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = osv-scanner;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Vulnerability scanner written in Go which uses the data provided by https://osv.dev";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "osv-scanner";
|
2022-12-28 21:21:41 +00:00
|
|
|
homepage = "https://github.com/google/osv-scanner";
|
|
|
|
changelog = "https://github.com/google/osv-scanner/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ stehessel urandom ];
|
|
|
|
};
|
|
|
|
}
|