Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
buildNpmPackage,
fetchFromGitHub,
}:
buildNpmPackage (finalAttrs: {
pname = "mongosh";
version = "2.5.8";
src = fetchFromGitHub {
owner = "mongodb-js";
repo = "mongosh";
tag = "v${finalAttrs.version}";
hash = "sha256-VQJkhaPXy2Mg9uoV6qKFzACtJ6TMDWZj52wUvP/7SLg=";
};
npmDepsHash = "sha256-BnuzrIS/RtKReTPrSY/yQ5LRmA3PIGkv80rS+6IJZxQ=";
patches = [
./disable-telemetry.patch
];
npmFlags = [
"--omit=optional"
"--ignore-scripts"
];
npmBuildScript = "compile";
dontNpmInstall = true;
installPhase = ''
runHook preInstall
npmWorkspace=packages/mongosh npmInstallHook
cp -r packages configs $out/lib/node_modules/mongosh/
rm $out/lib/node_modules/mongosh/node_modules/@mongosh/docker-build-scripts # dangling symlink
runHook postInstall
'';
passthru = {
# Version testing is skipped because upstream often forgets to update the version.
updateScript = ./update.sh;
};
meta = {
homepage = "https://www.mongodb.com/try/download/shell";
description = "MongoDB Shell";
maintainers = with lib.maintainers; [ aaronjheng ];
license = lib.licenses.asl20;
mainProgram = "mongosh";
};
})