From b7d8ea9668666f58310018b6c57ddacb619423b0 Mon Sep 17 00:00:00 2001 From: Graham McInitre Date: Thu, 16 Jul 2026 09:09:38 -0500 Subject: [PATCH] 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. --- nix/shell.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/nix/shell.nix b/nix/shell.nix index c9ea77c7..e4f99313 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -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