2024-04-21 15:54:59 +00:00
|
|
|
{ lib
|
|
|
|
, buildNpmPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
|
|
|
, testers
|
|
|
|
, snyk
|
|
|
|
}:
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
buildNpmPackage rec {
|
|
|
|
pname = "snyk";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.1292.1";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "snyk";
|
|
|
|
repo = "cli";
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-N54fSRYTFOlmfpommEFIqbMP5IBkhatMwx4CQ8fd5QI=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
npmDepsHash = "sha256-VHZqc111cC8AANogxXVg4BFlngdmrrt7E+tCMF5Rl7g=";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postPatch = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
substituteInPlace package.json \
|
|
|
|
--replace-fail '"version": "1.0.0-monorepo"' '"version": "${version}"'
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE =
|
|
|
|
# Fix error: no member named 'aligned_alloc' in the global namespace
|
|
|
|
lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
npmBuildScript = "build:prod";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = snyk;
|
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Scans and monitors projects for security vulnerabilities";
|
|
|
|
homepage = "https://snyk.io";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/snyk/cli/releases/tag/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
license = licenses.asl20;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "snyk";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
}
|