From 07a772a7f937afaab656b29f9a77adba6f63e864 Mon Sep 17 00:00:00 2001 From: Graham McInitre Date: Thu, 16 Jul 2026 09:33:55 -0500 Subject: [PATCH] fix: pre-compile test deps in shellHook so mix test always works Add MIX_ENV=test mix deps.compile after NIF build. The _build/test tree is ephemeral (cleared when nix devShell derivation changes), which causes 'Mox is not available' errors. This ensures test deps like Mox are ready before the user ever runs mix test. --- nix/shell.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nix/shell.nix b/nix/shell.nix index 74e8853d..b0b34f37 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -332,6 +332,10 @@ mkShell { make -C c_src fi + # Pre-compile test dependencies so mix test works immediately. + # The _build/test tree is ephemeral (cleared when nix devShell changes). + MIX_ENV=test mix deps.compile 2>/dev/null || true + # Auto-start services on first shell entry. # Run in a detached subshell to prevent nix develop from waiting # on daemonized PostgreSQL/Redis child processes.