diff --git a/pkgs/development/beam-modules/build-mix.nix b/pkgs/development/beam-modules/build-mix.nix index a0e088a024ee..d61b5e91556b 100644 --- a/pkgs/development/beam-modules/build-mix.nix +++ b/pkgs/development/beam-modules/build-mix.nix @@ -6,6 +6,10 @@ , buildInputs ? [ ] , nativeBuildInputs ? [ ] , erlangCompilerOptions ? [ ] + # Deterministic Erlang builds remove full system paths from debug information + # among other things to keep builds more reproducible. See their docs for more: + # https://www.erlang.org/doc/man/compile +, erlangDeterministicBuilds ? true , beamDeps ? [ ] , propagatedBuildInputs ? [ ] , postPatch ? "" @@ -35,7 +39,7 @@ let ERL_COMPILER_OPTIONS = let - options = [ "deterministic" ] ++ erlangCompilerOptions; + options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ]; in "[${lib.concatStringsSep "," options}]"; diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix index b25c609bd3bc..a762b8e0bc2e 100644 --- a/pkgs/development/beam-modules/mix-release.nix +++ b/pkgs/development/beam-modules/mix-release.nix @@ -33,6 +33,11 @@ # See https://www.erlang.org/doc/man/compile , erlangCompilerOptions ? [ ] + # Deterministic Erlang builds remove full system paths from debug information + # among other things to keep builds more reproducible. See their docs for more: + # https://www.erlang.org/doc/man/compile +, erlangDeterministicBuilds ? true + # Mix dependencies provided as a fixed output derivation , mixFodDeps ? null @@ -100,7 +105,7 @@ stdenv.mkDerivation (overridable // { ERL_COMPILER_OPTIONS = let - options = [ "deterministic" ] ++ erlangCompilerOptions; + options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ]; in "[${lib.concatStringsSep "," options}]";