Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, buildGoModule 3, fetchFromGitHub 4, testers 5, osv-scanner 6}: 7buildGoModule rec { 8 pname = "osv-scanner"; 9 version = "1.3.3"; 10 11 src = fetchFromGitHub { 12 owner = "google"; 13 repo = pname; 14 rev = "v${version}"; 15 hash = "sha256-J1oOkHh1xHwY8CUq5X+bAfhIbE3/fss5tiZA5/90nhw="; 16 }; 17 18 vendorHash = "sha256-xarDkQNYa/xl8f0MRdsb+/29B8bY5Ts+MbYHGb5yP10="; 19 20 subPackages = [ 21 "cmd/osv-scanner" 22 ]; 23 24 ldflags = [ 25 "-s" 26 "-w" 27 "-X main.version=${version}" 28 "-X main.commit=n/a" 29 "-X main.date=1970-01-01T00:00:00Z" 30 ]; 31 32 # Tests require network connectivity to query https://api.osv.dev. 33 doCheck = false; 34 35 passthru.tests.version = testers.testVersion { 36 package = osv-scanner; 37 }; 38 39 meta = with lib; { 40 description = "Vulnerability scanner written in Go which uses the data provided by https://osv.dev"; 41 homepage = "https://github.com/google/osv-scanner"; 42 changelog = "https://github.com/google/osv-scanner/releases/tag/v${version}"; 43 license = licenses.asl20; 44 maintainers = with maintainers; [ stehessel urandom ]; 45 }; 46}