nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildNpmPackage
3, fetchFromGitHub
4, stdenv
5, testers
6, snyk
7}:
8
9buildNpmPackage rec {
10 pname = "snyk";
11 version = "1.1292.1";
12
13 src = fetchFromGitHub {
14 owner = "snyk";
15 repo = "cli";
16 rev = "refs/tags/v${version}";
17 hash = "sha256-N54fSRYTFOlmfpommEFIqbMP5IBkhatMwx4CQ8fd5QI=";
18 };
19
20 npmDepsHash = "sha256-VHZqc111cC8AANogxXVg4BFlngdmrrt7E+tCMF5Rl7g=";
21
22 postPatch = ''
23 substituteInPlace package.json \
24 --replace-fail '"version": "1.0.0-monorepo"' '"version": "${version}"'
25 '';
26
27 env.NIX_CFLAGS_COMPILE =
28 # Fix error: no member named 'aligned_alloc' in the global namespace
29 lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
30
31 npmBuildScript = "build:prod";
32
33 passthru.tests.version = testers.testVersion {
34 package = snyk;
35 };
36
37 meta = with lib; {
38 description = "Scans and monitors projects for security vulnerabilities";
39 homepage = "https://snyk.io";
40 changelog = "https://github.com/snyk/cli/releases/tag/v${version}";
41 license = licenses.asl20;
42 maintainers = [ ];
43 mainProgram = "snyk";
44 };
45}