fix: detach service startup to prevent nix develop hang

Run start-services in a background subshell with stdin closed so
nix develop doesn't wait on daemonized PostgreSQL/Redis child
processes before starting the interactive shell.
This commit is contained in:
Graham McInitre 2026-07-16 09:09:38 -05:00
parent 38b7fb00f1
commit b7d8ea9668

View file

@ -326,14 +326,11 @@ mkShell {
mix local.hex --force --if-missing > /dev/null 2>&1
mix local.rebar --force --if-missing > /dev/null 2>&1
# Auto-start services on first shell entry
# Auto-start services on first shell entry.
# Run in a detached subshell to prevent nix develop from waiting
# on daemonized PostgreSQL/Redis child processes.
if [ ! -f "${servicesFlag}" ]; then
${startServices}/bin/start-services
# Run migrations if databases exist and Mix deps are available
if [ -d "deps" ] && mix ecto.migrate 2>/dev/null; then
echo " Database migrations applied"
fi
( ${startServices}/bin/start-services </dev/null & )
fi
# Install pre-commit hooks