snyk: refactor

This commit is contained in:
Fabian Affolter 2024-03-27 09:32:18 +01:00 committed by GitHub
parent 9505dd8fc1
commit 4409f04b23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,10 @@
{ buildNpmPackage, fetchFromGitHub, lib, stdenv, testers, snyk }: { lib
, buildNpmPackage
, fetchFromGitHub
, stdenv
, testers
, snyk
}:
buildNpmPackage rec { buildNpmPackage rec {
pname = "snyk"; pname = "snyk";
@ -7,14 +13,15 @@ buildNpmPackage rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "snyk"; owner = "snyk";
repo = "cli"; repo = "cli";
rev = "v${version}"; rev = "refs/tags/v${version}";
hash = "sha256-tckifLV+HC7NqTeBtZI+VjZveeVbRS5+63vL8k8qE4s="; hash = "sha256-tckifLV+HC7NqTeBtZI+VjZveeVbRS5+63vL8k8qE4s=";
}; };
npmDepsHash = "sha256-deBtINc+P0NnCIb0jI0Mvn2zbWS6qLqCXL6nKSFGqOI="; npmDepsHash = "sha256-deBtINc+P0NnCIb0jI0Mvn2zbWS6qLqCXL6nKSFGqOI=";
postPatch = '' postPatch = ''
substituteInPlace package.json --replace '"version": "1.0.0-monorepo"' '"version": "${version}"' substituteInPlace package.json \
--replace-fail '"version": "1.0.0-monorepo"' '"version": "${version}"'
''; '';
env.NIX_CFLAGS_COMPILE = env.NIX_CFLAGS_COMPILE =
@ -29,9 +36,10 @@ buildNpmPackage rec {
meta = with lib; { meta = with lib; {
description = "Scans and monitors projects for security vulnerabilities"; description = "Scans and monitors projects for security vulnerabilities";
mainProgram = "snyk";
homepage = "https://snyk.io"; homepage = "https://snyk.io";
changelog = "https://github.com/snyk/cli/releases/tag/v${version}";
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ ]; maintainers = with maintainers; [ ];
mainProgram = "snyk";
}; };
} }