1{ stdenv, pkgs, erlang }:
2
3let
4 inherit (stdenv.lib) makeExtensible;
5
6 lib = pkgs.callPackage ./lib.nix {};
7
8 # FIXME: add support for overrideScope
9 callPackageWithScope = scope: drv: args: stdenv.lib.callPackageWith scope drv args;
10 mkScope = scope: pkgs // scope;
11
12 packages = self:
13 let
14 defaultScope = mkScope self;
15 callPackage = drv: args: callPackageWithScope defaultScope drv args;
16 in
17 import ./hex-packages.nix {
18 inherit pkgs stdenv callPackage;
19 } // rec {
20 inherit callPackage erlang;
21 beamPackages = self;
22
23 hexRegistrySnapshot = callPackage ./hex-registry-snapshot.nix { };
24
25 rebar = callPackage ../tools/build-managers/rebar { };
26 rebar3-open = callPackage ../tools/build-managers/rebar3 { };
27 rebar3 = callPackage ../tools/build-managers/rebar3 { };
28
29 # rebar3 port compiler plugin is required by buildRebar3
30 pc_1_6_0 = callPackage ./pc {};
31 pc = pc_1_6_0;
32
33 fetchHex = callPackage ./fetch-hex.nix { };
34
35 fetchRebar3Deps = callPackage ./fetch-rebar-deps.nix { };
36 rebar3Relx = callPackage ./rebar3-release.nix { };
37
38 buildRebar3 = callPackage ./build-rebar3.nix {};
39 buildHex = callPackage ./build-hex.nix {};
40 buildErlangMk = callPackage ./build-erlang-mk.nix {};
41 buildMix = callPackage ./build-mix.nix {};
42
43 # BEAM-based languages.
44 elixir = elixir_1_7;
45
46 elixir_1_8 = lib.callElixir ../interpreters/elixir/1.8.nix {
47 inherit rebar erlang;
48 debugInfo = true;
49 };
50
51 elixir_1_7 = lib.callElixir ../interpreters/elixir/1.7.nix {
52 inherit rebar erlang;
53 debugInfo = true;
54 };
55
56 elixir_1_6 = lib.callElixir ../interpreters/elixir/1.6.nix {
57 inherit rebar erlang;
58 debugInfo = true;
59 };
60
61 elixir_1_5 = lib.callElixir ../interpreters/elixir/1.5.nix {
62 inherit rebar erlang;
63 debugInfo = true;
64 };
65
66 elixir_1_4 = lib.callElixir ../interpreters/elixir/1.4.nix {
67 inherit rebar erlang;
68 debugInfo = true;
69 };
70
71 # Remove old versions of elixir, when the supports fades out:
72 # https://hexdocs.pm/elixir/compatibility-and-deprecations.html
73
74 lfe = lfe_1_2;
75 lfe_1_2 = lib.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; };
76
77 # Non hex packages. Examples how to build Rebar/Mix packages with and
78 # without helper functions buildRebar3 and buildMix.
79 hex = callPackage ./hex {};
80 webdriver = callPackage ./webdriver {};
81 relxExe = callPackage ../tools/erlang/relx-exe {};
82
83 # The tool used to upgrade hex-packages.nix.
84 hex2nix = callPackage ../tools/erlang/hex2nix {};
85
86 # An example of Erlang/C++ package.
87 cuter = callPackage ../tools/erlang/cuter {};
88 };
89in makeExtensible packages