nixpkgs/pkgs/tools/security/osv-scanner/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-18 16:54:13 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
, testers
, osv-scanner
}:
2024-04-19 14:35:09 +02:00
2022-12-18 16:54:13 +01:00
buildGoModule rec {
pname = "osv-scanner";
2024-05-09 03:30:39 +02:00
version = "1.7.3";
2022-12-18 16:54:13 +01:00
src = fetchFromGitHub {
owner = "google";
2024-04-19 14:35:09 +02:00
repo = "osv-scanner";
rev = "refs/tags/v${version}";
2024-05-09 03:30:39 +02:00
hash = "sha256-tagTrjsYPT5csm841HvPbtUsbsaapS8JuHwsPTZWheA=";
2022-12-18 16:54:13 +01:00
};
2024-05-09 03:30:39 +02:00
vendorHash = "sha256-yu6qefmTiMRGeyOkiQVOtXQu3BGE2SBHerWNlDDlZxw=";
subPackages = [
"cmd/osv-scanner"
];
2022-12-18 16:54:13 +01:00
ldflags = [
"-s"
"-w"
2024-04-19 14:35:09 +02: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-18 16:54:13 +01: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";
mainProgram = "osv-scanner";
2022-12-18 16:54:13 +01: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 ];
};
}