···2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
0005}:
67buildNpmPackage (finalAttrs: {
8 pname = "mongosh";
9+ version = "2.5.5";
1011 src = fetchFromGitHub {
12 owner = "mongodb-js";
13 repo = "mongosh";
14 tag = "v${finalAttrs.version}";
15+ hash = "sha256-dngguv/ShxwfFpbYyyfJ1SmQhSgEsDOKcRSXdjsfcmo=";
16 };
1718+ npmDepsHash = "sha256-W5qq3XUV+x0Ko1Ftp2JTHbaOSGsSG5a7qABthtnaU4o=";
1920 patches = [
21 ./disable-telemetry.patch
00000022 ];
2324 npmFlags = [
···36 '';
3738 passthru = {
39+ # Version testing is skipped because upstream often forgets to update the version.
40+41+ updateScript = ./update.sh;
00000042 };
4344 meta = {
+8
pkgs/by-name/mo/mongosh/update.sh
···00000000
···1+#!/usr/bin/env nix-shell
2+#!nix-shell -i bash -p curl nix-update jq
3+4+# GitHub tags include many unrelated subpackage versions, making it unreliable to determine the latest mongosh version.
5+# Fetch the latest mongosh version directly from the npm registry instead.
6+version="$(curl -fsSL https://registry.npmjs.org/mongosh/latest | jq -r ".version")"
7+8+nix-update --version "$version" mongosh