-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for mongodb #339
base: main
Are you sure you want to change the base?
Conversation
Thanks! Could you add some basic docs? See https://community.flake.parts/services-flake/contributing#service-doc |
This dependency seems to be broken on Darwin. If the tests run on Linux you can conditionally disable it on Darwin (linking to upstream issue, if any): Lines 50 to 55 in 23e40bd
|
You can use python311 since the default now is 3.12 which suffers from the breakage |
Btw mongodb is never built by official nix hydra due to licence but I’ve seen it in devenv’s cache (including macOS). Might have to pull it from older nixpkgs commit |
I'll get on docs right now (sorry, I was at a company off-site last week when I put the PR together and haven't gotten back to it since getting home), along with setting the restriction on Darwin if it is indeed completely broken there. As for there not being a binary cache, that was apparent the first time I fired up the test environment while I was rolling this for some dev work I was doing. On my work issued laptop (recent gen mobile Intel i7) the compile takes around 2 to 3 hours the first time it compiles Mongo, but it did go through without a hitch. After that first build, it's just as fast as anything else that you have locally cached. I know there are ways to set binary cache hints in a flake or such. But that would necessitate integrating with a binary cache, so I don't know if that's what you want to do here. Maybe I will just put a disclaimer in the docs letting people know that compiling. From the point of view of the CI testing in this repo, though, I don't know what you might want to do. |
d4101b8
to
18a962e
Compare
I've updated the test to be dependent on the |
MongoDB currently fails to build on Darwin because of a transitive build dep on jaraco-path. So we make the test dependent on that. I do not, however, choose to completely disable MongoDB because someone might have workarounds for the package building in their environment.
18a962e
to
6dc8bdf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a few more changes and I can merge
name = "start-mongodb"; | ||
runtimeInputs = [ pkgs.coreutils config.package ]; | ||
text = '' | ||
set -euo pipefail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed as writeShellApplication
sets it by default: https://github.com/NixOS/nixpkgs/blob/0b86640b433332928f978942427300733ebca24c/pkgs/build-support/trivial-builders/default.nix#L253C23-L253C53
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be removed
I am referring to set -euo pipefail
configScript = pkgs.writeShellApplication { | ||
name = "configure-mongo"; | ||
text = '' | ||
if ! test -e "${config.dataDir}/.auth_configured"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An else condition echo
ing that the database is already configured will be helpful?
Adds support for running MongoDB, based off the Redis workflow.