-
Notifications
You must be signed in to change notification settings - Fork 6
/
.envrc
42 lines (35 loc) · 1.4 KB
/
.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
37
38
39
40
41
42
# if nix is installed, use it
if [ ! -r .nix-disable ] && has nix-env; then
# set NIX_PROFILE so nix-env operations don't need to manually
# specify the profile path
export NIX_PROFILE=/nix/var/nix/profiles/mymove-docs
# Having NIX_SSL_CERT_FILE set means go won't use macOS keychain
# based certs
# MOST projects can leave this set, but if you are using go and
# custom certificates, you might need to futz with this
# export NIX_SSL_CERT_FILE_ORIG=$NIX_SSL_CERT_FILE
# unset NIX_SSL_CERT_FILE
nix_dir="nix"
# add the nix files so that if they change, direnv needs to be reloaded
watch_file "${nix_dir}"/*.nix
config_hash=$(nix-hash "${nix_dir}")
store_hash=$(nix-store -q --hash "${NIX_PROFILE}")
# The .nix-hash file is created by nix/update.sh
if [ ! -r .nix-hash ] || ! grep -q "${config_hash}-${store_hash}" .nix-hash; then
log_status "WARNING: nix packages out of date. Run ${nix_dir}/update.sh"
fi
# add the NIX_PROFILE bin path so that everything we just installed
# is available on the path
PATH_add ${NIX_PROFILE}/bin
# If you use go, add this
#
# nix is immutable, so we need to specify a path for local changes, e.g.
# binaries can be installed local to this project
export GOPATH=$PWD/.gopath
PATH_add ./.gopath/bin
# If you use node, add this
#
PATH_add ./node_modules/.bin
export NPM_CONFIG_PREFIX=$PWD/.npmglobal
PATH_add ./.npmglobal/bin
fi