-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc
36 lines (28 loc) · 865 Bytes
/
.envrc
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
dotenv_if_exists
use flake
#auto-setup project
LOCAL_PATH=$(pwd)
export NIX_SHELL_DIR="$LOCAL_PATH/.nix-shell"
export EXERCISM_CONFIG_HOME="$NIX_SHELL_DIR/exercism"
test -d $NIX_SHELL_DIR && mkdir -p $NIX_SHELL_DIR
export LANG="en_US.UTF-8"
# elixir
export MIX_HOME="$NIX_SHELL_DIR/elixir/.mix"
export MIX_ARCHIVES="$MIX_HOME/archives"
export HEX_HOME="$NIX_SHELL_DIR/elixir/.hex"
if ! test -d $MIX_HOME; then
mix local.hex --force
mix local.rebar --force
fi
# python
export PYTHONPATH="$NIX_SHELL_DIR/python"
# exercism
if [[ ! -f $EXERCISM_CONFIG_HOME/user.json ]]; then
if [[ -v EXERCISM_TOKEN ]]; then
if [[ -x "$(command -v exercism)" ]]; then
exercism configure --token=$EXERCISM_TOKEN -w $LOCAL_PATH
fi
else
echo "No exercism token found. Please set the EXERCISM_TOKEN environment variable."
fi
fi