diff --git a/nix/c-nif.nix b/nix/c-nif.nix index a0c502ce..bf64d982 100644 --- a/nix/c-nif.nix +++ b/nix/c-nif.nix @@ -26,15 +26,13 @@ stdenv.mkDerivation { erlang ]; - # Set Erlang include path for NIF headers - preBuild = '' - export ERL_INCLUDE_PATH="${erlang}/lib/erlang/erts-${erlang.version}/include" - ''; - # Build using the existing Makefile buildPhase = '' runHook preBuild + # Find the actual erts include directory + export ERL_INCLUDE_PATH=$(find ${erlang}/lib/erlang -type d -name "erts-*" | head -1)/include + cd c_src make -j$NIX_BUILD_CORES