-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
61 lines (48 loc) · 1.49 KB
/
shell.nix
File metadata and controls
61 lines (48 loc) · 1.49 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
{ pkgs }:
with pkgs;
let
projectName = "orca";
tailwind = nodePackages.tailwindcss;
ciTest = pkgs.writeScriptBin "ci-test" ''
# echo "Avoid utf-8 issues"
export LANG=en_US.UTF-8
echo "Installing hex and rebar"
mix local.hex --force
mix local.rebar --force
echo "Fetching Deps"
MIX_ENV=test mix deps.get
echo "Running tests"
MIX_ENV=test mix test
'';
in
mkShell {
name = "${projectName}-shell";
buildInputs = [
ciTest
glibcLocalesUtf8
elixir
nodejs
yarn2nix
nodePackages.prettier
nodePackages.yarn
nodePackages.tailwindcss
] ++ lib.optionals stdenv.isLinux
[
libnotify # For ExUnit Notifier on Linux.
inotify-tools # For file_system on Linux.
]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks;
[
terminal-notifier # For ExUnit Notifier on macOS.
CoreFoundation CoreServices # For file_system on macOS.
]);
# Fixes locale issue on `nix-shell --pure` (at least on NixOS). See
# + https://github.com/NixOS/nix/issues/318#issuecomment-52986702
# + http://lists.linuxfromscratch.org/pipermail/lfs-support/2004-June/023900.html
#export LC_ALL="en_US.UTF-8";
LOCALE_ARCHIVE = if pkgs.stdenv.isLinux then "${pkgs.glibcLocalesUtf8}/lib/locale/locale-archive" else "";
MIX_TAILWIND_PATH="${tailwind}/bin/tailwind";
MIX_TAILWIND_VERSION="${tailwind.version}";
MIX_ESBUILD_PATH="${esbuild}/bin/esbuild";
MIX_ESBUILD_VERSION="${esbuild.version}";
}