Files
nixpkgs/pkgs/by-name/ni/ni/package.nix
Sefa Eyeoglu 496365ec6d treewide: adjust pnpm.fetchDeps parameter order
It is more common to specify hash as the last attribute of fetcher
function args. Let's move fetcherVersion right above hash for all
occurrences.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
(cherry picked from commit a8c9a2aa3e)
2025-07-23 18:02:12 +02:00

68 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
nodejs,
pnpm_9,
npmHooks,
versionCheckHook,
nix-update-script,
}:
let
pnpm = pnpm_9;
in
stdenv.mkDerivation (finalAttrs: {
pname = "ni";
version = "23.3.1";
src = fetchFromGitHub {
owner = "antfu-collective";
repo = "ni";
tag = "v${finalAttrs.version}";
hash = "sha256-jkynuN7w0YaIYQLX0KsEQWqrXkhvh3qKSLK63A/7mx8=";
};
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
fetcherVersion = 1;
hash = "sha256-gDBjAwut217mdbWyk/dSU4JOkoRbOk4Czlb/lXhWqRU=";
};
nativeBuildInputs = [
nodejs
pnpm.configHook
npmHooks.npmInstallHook
];
buildPhase = ''
runHook preBuild
pnpm run build
find dist -type f \( -name '*.cjs' -or -name '*.cts' -or -name '*.ts' \) -delete
runHook postBuild
'';
dontNpmPrune = true;
postInstall = ''
rm -rf $out/lib/node_modules/@antfu/ni/node_modules
'';
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Use the right package manager";
homepage = "https://github.com/antfu-collective/ni";
changelog = "https://github.com/antfu-collective/ni/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
mainProgram = "ni";
};
})