depot/pkgs/by-name/sn/snyk/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

51 lines
1.2 KiB
Nix

{
lib,
buildNpmPackage,
fetchFromGitHub,
stdenv,
testers,
snyk,
}:
let
version = "1.1294.0";
in
buildNpmPackage {
pname = "snyk";
inherit version;
src = fetchFromGitHub {
owner = "snyk";
repo = "cli";
rev = "refs/tags/v${version}";
hash = "sha256-AO36b3VWdklfMjSEE3JMZUVS1KmBSra2xX6hqlf3OUM=";
};
npmDepsHash = "sha256-xGRmZyDXZVuFdpT1LcSLBh9bY86rOjGvVjyCt9PSigg=";
postPatch = ''
substituteInPlace package.json \
--replace-fail '"version": "1.0.0-monorepo"' '"version": "${version}"'
'';
env.NIX_CFLAGS_COMPILE =
# Fix error: no member named 'aligned_alloc' in the global namespace
lib.optionalString (
stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64
) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1";
npmBuildScript = "build:prod";
passthru.tests.version = testers.testVersion {
package = snyk;
};
meta = {
description = "Scans and monitors projects for security vulnerabilities";
homepage = "https://snyk.io";
changelog = "https://github.com/snyk/cli/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ momeemt ];
mainProgram = "snyk";
};
}