-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathflake.nix
46 lines (38 loc) · 1.18 KB
/
flake.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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
beamPkgs = with pkgs.beam_minimal; packagesWith interpreters.erlang_27;
erlang = beamPkgs.erlang;
elixir = beamPkgs.elixir_1_17;
in
{
devShells."${system}".default = pkgs.mkShell {
buildInputs = [
erlang
elixir
beamPkgs.hex
beamPkgs.elixir-ls
pkgs.inotifyTools
pkgs.nodejs
];
ERL_INCLUDE_PATH = "${erlang}/lib/erlang/usr/include";
ERL_AFLAGS = "-kernel shell_history enabled";
shellHook = ''
# Allow mix to work on local directory
mkdir -p .nix-mix
mkdir -p .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-hex
export ERL_LIBS=$HEX_HOME/lib/erlang/lib
# Concat paths
export PATH=$MIX_HOME/bin:$PATH
export PATH=$MIX_HOME/escripts:$PATH
export PATH=$HEX_HOME/bin:$PATH
# "Run: `mix archive.install hex phx_new` for phoenix."
'';
};
};
}