From 7fd57568945bb24f73ff752b44621a4401fd6b3d Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Thu, 12 Feb 2026 18:39:36 +0100 Subject: [PATCH 1/2] beamPackages.fetchMixDeps: move env variables into env for structuredAttrs --- .../beam-modules/fetch-mix-deps.nix | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/pkgs/development/beam-modules/fetch-mix-deps.nix b/pkgs/development/beam-modules/fetch-mix-deps.nix index b7b3a40e25e1..eb716c57818d 100644 --- a/pkgs/development/beam-modules/fetch-mix-deps.nix +++ b/pkgs/development/beam-modules/fetch-mix-deps.nix @@ -53,17 +53,20 @@ stdenvNoCC.mkDerivation ( git ]; - MIX_ENV = mixEnv; - MIX_TARGET = mixTarget; - MIX_DEBUG = if debug then 1 else 0; - DEBUG = if debug then 1 else 0; # for rebar3 - # the api with `mix local.rebar rebar path` makes a copy of the binary - MIX_REBAR = "${rebar}/bin/rebar"; - MIX_REBAR3 = "${rebar3}/bin/rebar3"; - # there is a persistent download failure with absinthe 1.6.3 - # those defaults reduce the failure rate - HEX_HTTP_CONCURRENCY = 1; - HEX_HTTP_TIMEOUT = 120; + env = { + MIX_ENV = mixEnv; + MIX_TARGET = mixTarget; + MIX_DEBUG = if debug then 1 else 0; + DEBUG = if debug then 1 else 0; # for rebar3 + # the api with `mix local.rebar rebar path` makes a copy of the binary + MIX_REBAR = "${rebar}/bin/rebar"; + MIX_REBAR3 = "${rebar3}/bin/rebar3"; + # there is a persistent download failure with absinthe 1.6.3 + # those defaults reduce the failure rate + HEX_HTTP_CONCURRENCY = 1; + HEX_HTTP_TIMEOUT = 120; + } + // (attrs.env or { }); configurePhase = attrs.configurePhase or '' From c01477389a1fbd5784e360b4a32c18536a87710b Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Thu, 12 Feb 2026 18:39:58 +0100 Subject: [PATCH 2/2] beamPackages.mixRelease: move env variables into env for structuredAttrs --- pkgs/development/beam-modules/mix-release.nix | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix index feda1738dbef..27a318085710 100644 --- a/pkgs/development/beam-modules/mix-release.nix +++ b/pkgs/development/beam-modules/mix-release.nix @@ -123,28 +123,31 @@ stdenv.mkDerivation ( buildInputs = buildInputs ++ lib.optionals (escriptBinName != null) [ erlang ]; - MIX_ENV = mixEnv; - MIX_TARGET = mixTarget; - MIX_BUILD_PREFIX = (if mixTarget == "host" then "" else "${mixTarget}_") + "${mixEnv}"; - MIX_DEBUG = if enableDebugInfo then 1 else 0; - HEX_OFFLINE = 1; - __darwinAllowLocalNetworking = true; - DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation - # The API with `mix local.rebar rebar path` makes a copy of the binary - # some older dependencies still use rebar. - MIX_REBAR = "${rebar}/bin/rebar"; - MIX_REBAR3 = "${rebar3}/bin/rebar3"; + env = { + MIX_ENV = mixEnv; + MIX_TARGET = mixTarget; + MIX_BUILD_PREFIX = (if mixTarget == "host" then "" else "${mixTarget}_") + "${mixEnv}"; + MIX_DEBUG = if enableDebugInfo then 1 else 0; + HEX_OFFLINE = 1; - ERL_COMPILER_OPTIONS = - let - options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ]; - in - "[${lib.concatStringsSep "," options}]"; + DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation + # The API with `mix local.rebar rebar path` makes a copy of the binary + # some older dependencies still use rebar. + MIX_REBAR = "${rebar}/bin/rebar"; + MIX_REBAR3 = "${rebar3}/bin/rebar3"; - LANG = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "C"; - LC_CTYPE = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "UTF-8"; + ERL_COMPILER_OPTIONS = + let + options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ]; + in + "[${lib.concatStringsSep "," options}]"; + + LANG = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "C"; + LC_CTYPE = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "UTF-8"; + } + // (attrs.env or { }); postUnpack = '' # Mix and Hex