-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
31 lines (27 loc) · 827 Bytes
/
Copy pathshell.nix
File metadata and controls
31 lines (27 loc) · 827 Bytes
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
{ pkgs ? (import <nixpkgs> { }), ... }:
with pkgs;
let
otp = beam.packages.erlang_26;
elixir = otp.elixir_1_15;
in
pkgs.mkShell {
buildInputs = [
elixir
otp.erlang
((if otp ? elixir-ls then otp.elixir-ls else otp.elixir_ls).override { inherit elixir; })
];
shellHook = ''
# keep your shell history in iex
export ERL_AFLAGS="-kernel shell_history enabled"
# Force UTF8 in CLI
export LANG="C.UTF-8"
# this isolates mix to work only in local directory
mkdir -p .nix-mix .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-hex
# make hex from Nixpkgs available
# `mix local.hex` will install hex into MIX_HOME and should take precedence
export MIX_PATH="${otp.hex}/lib/erlang/lib/hex/ebin"
export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH
'';
}