diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix --- a/nix/dev-shell.nix +++ b/nix/dev-shell.nix @@ -22,6 +22,7 @@ , libiconv , libuv , mariadb +, mariadb-up , nodejs-16_x , olm , openjdk8 @@ -114,6 +115,16 @@ export ANDROID_SDK_ROOT=''${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk} fi + '' + # Darwin condition can be removed once linux services are supported + + lib.optionalString stdenv.isDarwin '' + # Start development services + ${mariadb-up}/bin/mariadb-up & + mariadb_pid=$! + + wait "$mariadb_pid" + '' + '' + # Provide decent bash prompt source "${better-prompt}/bin/better-prompt" diff --git a/nix/mariadb-up-mac.nix b/nix/mariadb-up-mac.nix --- a/nix/mariadb-up-mac.nix +++ b/nix/mariadb-up-mac.nix @@ -126,5 +126,9 @@ echo "View MariaDB Logs: tail -f $MARIADB_DATA_HOME/logs" >&2 echo "Kill MariaDB server: pkill mariadbd" >&2 + + # Explicitly exit this script so the parent shell can determine + # when it's safe to return control of terminal to user + exit 0 ''; }