15 , erlang ? inputs.erlang
19 , src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; }
20 , escriptPath ? "lib/elixir/generate_app.escript"
24 inherit (lib) getVersion versionAtLeast optional concatStringsSep;
27 assert versionAtLeast (getVersion erlang) minimumOTPVersion;
29 stdenv.mkDerivation ({
30 pname = "${baseName}";
32 inherit src version debugInfo;
34 nativeBuildInputs = [ makeWrapper ];
35 buildInputs = [ erlang ];
42 erlc_opts = [ "deterministic" ]
43 ++ optional debugInfo "debug_info";
45 "[${concatStringsSep "," erlc_opts}]";
48 patchShebangs ${escriptPath} || true
50 substituteInPlace Makefile \
51 --replace "/usr/local" $out
55 # Elixir binaries are shell scripts which run erl. Add some stuff
56 # to PATH so the scripts can run without problems.
58 for f in $out/bin/*; do
60 if [ "$b" = mix ]; then continue; fi
62 --prefix PATH ":" "${lib.makeBinPath [ erlang coreutils curl bash ]}"
65 substituteInPlace $out/bin/mix \
66 --replace "/usr/bin/env elixir" "${coreutils}/bin/env $out/bin/elixir"
69 pos = builtins.unsafeGetAttrPos "sha256" args;
71 homepage = "https://elixir-lang.org/";
72 description = "Functional, meta-programming aware language built on top of the Erlang VM";
75 Elixir is a functional, meta-programming aware language built on
76 top of the Erlang VM. It is a dynamic language with flexible
77 syntax and macro support that leverages Erlang's abilities to
78 build concurrent, distributed and fault-tolerant applications
79 with hot code upgrades.
82 license = licenses.epl10;
83 platforms = platforms.unix;
84 maintainers = teams.beam.members;