-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.nix
49 lines (45 loc) · 1.17 KB
/
lib.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
lib: allSystems: defaultSystems: rec {
inherit allSystems defaultSystems;
asdfOverlay = import lib/asdfOverlay.nix lib;
beamOverlay = import lib/beamOverlay.nix;
asdfPakcages = import lib/asdfPakcages.nix lib;
beamPackages = import lib/beamPackages.nix;
devShell =
{
pkgs,
lsp ? pkgs.elixir-ls,
erlang ? pkgs.erlang,
elixir ? pkgs.elixir,
wxSupport ? true,
...
}@args:
let
overlay = beamOverlay { inherit erlang elixir wxSupport; };
finalPkgs = pkgs.extend overlay;
extraArgs = lib.removeAttrs args [
"pkgs"
"lsp"
"erlang"
"elixir"
"wxSupport"
];
in
finalPkgs.callPackage lib/elixirDevShell.nix { inherit lsp extraArgs; };
asdfDevShell =
{
pkgs,
...
}@args:
assert (
lib.assertMsg (!(args ? src)) ''
"src" has been deprecated in favor of "toolVersions". toolVersions should be the .tool-versions file itself.
''
);
let
asdf = import lib/parseASDF.nix lib args.toolVersions;
devShellArgs = args // {
inherit (asdf) elixir erlang;
};
in
pkgs.callPackage devShell devShellArgs;
}