From 23e46addb3a15a629b7a9f7df12d47d7feb9d0d1 Mon Sep 17 00:00:00 2001 From: Lord-Valen Date: Wed, 30 Aug 2023 18:48:42 -0400 Subject: [PATCH] nodePackages.snyk: use buildNpmPackage --- pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 56 ------------------- .../tools/analysis/snyk/default.nix | 26 +++++++++ pkgs/top-level/all-packages.nix | 2 + 5 files changed, 29 insertions(+), 57 deletions(-) create mode 100644 pkgs/development/tools/analysis/snyk/default.nix diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index cfe9e2001638..314fe295e01c 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -85,6 +85,7 @@ mapAliases { readability-cli = pkgs.readability-cli; # Added 2023-06-12 reveal-md = pkgs.reveal-md; # added 2023-07-31 s3http = throw "s3http was removed because it was abandoned upstream"; # added 2023-08-18 + inherit (pkgs) snyk; # Added 2023-08-30 ssb-server = throw "ssb-server was removed because it was broken"; # added 2023-08-21 stf = throw "stf was removed because it was broken"; # added 2023-08-21 thelounge = pkgs.thelounge; # Added 2023-05-22 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index ca681cc1024e..34c56680efe0 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -251,7 +251,6 @@ , "shout" , "sloc" , "smartdc" -, "snyk" , "socket.io" , "speed-test" , "sql-formatter" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 3f5c4bcc0b11..571b64b3e3f7 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -110683,62 +110683,6 @@ in bypassCache = true; reconstructLock = true; }; - snyk = nodeEnv.buildNodePackage { - name = "snyk"; - packageName = "snyk"; - version = "1.1205.0"; - src = fetchurl { - url = "https://registry.npmjs.org/snyk/-/snyk-1.1205.0.tgz"; - sha512 = "pYnSzBQXZPtPjHZ/VWmu6/dGj0yae6wKddarAZdeCIWnm8RSJ194mormeccprZ6IK8RwAxApZcL2hET5mDjxnA=="; - }; - dependencies = [ - sources."@sentry-internal/tracing-7.64.0" - sources."@sentry/core-7.64.0" - sources."@sentry/node-7.64.0" - sources."@sentry/types-7.64.0" - sources."@sentry/utils-7.64.0" - sources."agent-base-6.0.2" - sources."boolean-3.2.0" - sources."cookie-0.4.2" - sources."debug-4.3.4" - sources."define-properties-1.2.0" - sources."detect-node-2.1.0" - sources."es6-error-4.1.1" - sources."escape-string-regexp-4.0.0" - sources."function-bind-1.1.1" - sources."get-intrinsic-1.2.1" - sources."global-agent-3.0.0" - sources."globalthis-1.0.3" - sources."has-1.0.3" - sources."has-property-descriptors-1.0.0" - sources."has-proto-1.0.1" - sources."has-symbols-1.0.3" - sources."https-proxy-agent-5.0.1" - sources."json-stringify-safe-5.0.1" - sources."lru-cache-6.0.0" - sources."lru_map-0.3.3" - sources."matcher-3.0.0" - sources."ms-2.1.2" - sources."object-keys-1.1.1" - sources."roarr-2.15.4" - sources."semver-7.5.4" - sources."semver-compare-1.0.0" - sources."serialize-error-7.0.1" - sources."sprintf-js-1.1.2" - sources."tslib-2.6.2" - sources."type-fest-0.13.1" - sources."yallist-4.0.0" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "snyk library and cli utility"; - homepage = "https://github.com/snyk/snyk#readme"; - license = "Apache-2.0"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; "socket.io" = nodeEnv.buildNodePackage { name = "socket.io"; packageName = "socket.io"; diff --git a/pkgs/development/tools/analysis/snyk/default.nix b/pkgs/development/tools/analysis/snyk/default.nix new file mode 100644 index 000000000000..09222eb1d6f2 --- /dev/null +++ b/pkgs/development/tools/analysis/snyk/default.nix @@ -0,0 +1,26 @@ +{ buildNpmPackage, fetchFromGitHub, nodePackages, python3, lib }: + +buildNpmPackage rec { + pname = "snyk"; + version = "1.1207.0"; + + src = fetchFromGitHub { + owner = "snyk"; + repo = "cli"; + rev = "v${version}"; + hash = "sha256-wEXE+dcAfBK7fuoB23RdPSbJCaovB5sXrFO0QGyf+aw="; + }; + + npmDepsHash = "sha256-j3lMQh8++pb/00d9H2v7QBkpxIJdsuRQoFkNiQbvnF4="; + + nativeBuildInputs = [ nodePackages.node-gyp python3 ]; + + npmBuildScript = "build:prod"; + + meta = with lib; { + description = "Scans and monitors projects for security vulnerabilities"; + homepage = "https://snyk.io"; + license = licenses.asl20; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f5575dccdfa4..c039720ad5b3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20203,6 +20203,8 @@ with pkgs; snore = callPackage ../tools/misc/snore { }; + snyk = callPackage ../development/tools/analysis/snyk { }; + snzip = callPackage ../tools/archivers/snzip { }; snowman = qt5.callPackage ../development/tools/analysis/snowman { };