···
10
+
common-updater-scripts,
22
-
url = "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-${version}.tgz";
23
-
hash = "sha256-XErxsovZyMR1UmwClxn5Bm08hoYHArCtn8TSv/8eDYo=";
26
-
url = "https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2204-${version}.tgz";
27
-
hash = "sha256-p1eBobdnJ/uPZHScWFs3AOB7/BJn/MZQ8+VpOHonY2A=";
30
-
url = "https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${version}.tgz";
31
-
hash = "sha256-RLq+aFJixSt3EginpgIHWnR4CGk0KX5cmC3QrbW3jJ8=";
33
-
"aarch64-darwin" = {
34
-
url = "https://fastdl.mongodb.org/osx/mongodb-macos-arm64-${version}.tgz";
35
-
hash = "sha256-kNzByPEXi5T3+vr6t/EJuKIDEfGybrsbBqJ8vaEV5tY=";
stdenv.mkDerivation (finalAttrs: {
44
-
(srcs version).${stdenv.hostPlatform.system}
45
-
or (throw "unsupported system: ${stdenv.hostPlatform.system}")
23
+
finalAttrs.passthru.sources.${stdenv.hostPlatform.system}
24
+
or (throw "Unsupported platform for mongodb-ce: ${stdenv.hostPlatform.system}");
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
···
install -Dm 755 bin/mongod -t $out/bin
install -Dm 755 bin/mongos -t $out/bin
65
-
nativeInstallCheckInputs = [ versionCheckHook ];
66
-
versionCheckProgram = "${placeholder "out"}/bin/mongod";
67
-
versionCheckProgramArg = "--version";
# Only enable the version install check on darwin.
# On Linux, this would fail as mongod relies on tcmalloc, which
# requires access to `/sys/devices/system/cpu/possible`.
# See https://github.com/NixOS/nixpkgs/issues/377016
doInstallCheck = stdenv.hostPlatform.isDarwin;
49
+
nativeInstallCheckInputs = [ versionCheckHook ];
50
+
versionCheckProgram = "${placeholder "out"}/bin/mongod";
51
+
versionCheckProgramArg = "--version";
55
+
"x86_64-linux" = fetchurl {
56
+
url = "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2404-${finalAttrs.version}.tgz";
57
+
hash = "sha256-dmXt+OxvDaJRXEn3hNoiYZ9ob//tmQp2lsU2XunTNLM=";
59
+
"aarch64-linux" = fetchurl {
60
+
url = "https://fastdl.mongodb.org/linux/mongodb-linux-aarch64-ubuntu2404-${finalAttrs.version}.tgz";
61
+
hash = "sha256-9FdODnUqzquSKk86BN5OL+fEO07hGYg1VAtytp7ehFM=";
63
+
"x86_64-darwin" = fetchurl {
64
+
url = "https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-${finalAttrs.version}.tgz";
65
+
hash = "sha256-LUUhqfgP1tIupe517TdLL97jUvBZsCvzMey3JtMVTmg=";
67
+
"aarch64-darwin" = fetchurl {
68
+
url = "https://fastdl.mongodb.org/osx/mongodb-macos-arm64-${finalAttrs.version}.tgz";
69
+
hash = "sha256-9SFfRbIWVXPupxvqmQlkacmcthycu840VIupCNBf7Ew=";
script = writeShellApplication {
name = "${finalAttrs.pname}-updateScript";
78
+
common-updater-scripts
···
# Check if the new version is available for download, if not, exit
curl -s https://www.mongodb.com/try/download/community-edition/releases | pup 'h3:not([id]) text{}' | grep "$NEW_VERSION"
95
-
if [[ "${version}" = "$NEW_VERSION" ]]; then
93
+
if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then
echo "The new version same as the old version."
100
-
+ lib.concatStrings (
102
-
nix-update --system ${system} --version "$NEW_VERSION" ${finalAttrs.pname}
103
-
'') finalAttrs.meta.platforms
98
+
for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do
99
+
update-source-version "mongodb-ce" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform"
···
maintainers = with lib.maintainers; [ drupol ];
128
-
platforms = lib.attrNames (srcs version);
125
+
platforms = lib.attrNames finalAttrs.passthru.sources;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];