diff --git a/doc/mongodb.md b/doc/mongodb.md index 0f286b76..339cb65b 100644 --- a/doc/mongodb.md +++ b/doc/mongodb.md @@ -6,6 +6,22 @@ Because of the licensing of MongoDB, the Nixpkgs derivation that provides the bi If you are using this for your own development, you should either put in place a [local binary cache](https://nixos.wiki/wiki/Binary_Cache) to match your flake, or be aware that the first time you spin up the service it could possibly take a long time to build. +## Pre-built binaries + +[mongodb-ce](https://github.com/NixOS/nixpkgs/blob/e58a261efb95afd52fb4a1cf35185a017327a96d/pkgs/by-name/mo/mongodb-ce/package.nix) package from [nixpkgs](https://github.com/NixOS/nixpkgs) fetches pre-built binaries[^why-pre-built]. You can also build the binary from scratch using [mongodb](https://github.com/NixOS/nixpkgs/blob/924e8aa12419c6ac57690ed47c1d9af580c818a2/pkgs/servers/nosql/mongodb/mongodb.nix) package: + +```nix +# Inside `process-compose.` +{ + services.mongodb."m1" = { + enable = true; + package = pkgs.mongodb; + }; +} +``` + +[why-pre-built]: For more context on why pre-built binary is used, see: https://github.com/juspay/services-flake/pull/360 + ## Usage example diff --git a/nix/services/mongodb.nix b/nix/services/mongodb.nix index 6dc599c0..e28ca140 100644 --- a/nix/services/mongodb.nix +++ b/nix/services/mongodb.nix @@ -4,7 +4,7 @@ let in { options = { - package = lib.mkPackageOption pkgs "mongodb" { }; + package = lib.mkPackageOption pkgs "mongodb-ce" { }; bind = lib.mkOption { type = types.nullOr types.str; diff --git a/test/flake.nix b/test/flake.nix index 9364a56d..f5a43b54 100644 --- a/test/flake.nix +++ b/test/flake.nix @@ -38,6 +38,7 @@ "${inputs.services-flake}/nix/services/elasticsearch_test.nix" "${inputs.services-flake}/nix/services/grafana_test.nix" "${inputs.services-flake}/nix/services/memcached_test.nix" + "${inputs.services-flake}/nix/services/mongodb_test.nix" "${inputs.services-flake}/nix/services/nginx/nginx_test.nix" "${inputs.services-flake}/nix/services/ollama_test.nix" "${inputs.services-flake}/nix/services/open-webui_test.nix" @@ -51,10 +52,6 @@ "${inputs.services-flake}/nix/services/tika_test.nix" "${inputs.services-flake}/nix/services/weaviate_test.nix" "${inputs.services-flake}/nix/services/zookeeper_test.nix" - ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ - # Due to a dependency problem, MongoDB does not build on Darwin, - # See https://github.com/NixOS/nixpkgs/issues/346003 - "${inputs.services-flake}/nix/services/mongodb_test.nix" ])); }; };