nixpkgs/pkgs/by-name/os/osv-scanner/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

49 lines
1.2 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, testers
, osv-scanner
}:
buildGoModule rec {
pname = "osv-scanner";
version = "1.9.1";
src = fetchFromGitHub {
owner = "google";
repo = "osv-scanner";
rev = "refs/tags/v${version}";
hash = "sha256-s288EHtF/YRkPVwe7b1+q/1ky8tQdHvzb8GaOPpRqTw=";
};
vendorHash = "sha256-DNUkUmxzej/NDwJ3lgPek/6C3/ytjlHmFIb1IvKvAQs=";
subPackages = [
"cmd/osv-scanner"
];
ldflags = [
"-s"
"-w"
"-X=github.com/google/osv-scanner/internal/version.OSVVersion=${version}"
"-X=main.commit=n/a"
"-X=main.date=1970-01-01T00:00:00Z"
];
# 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";
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 ];
};
}