-
Notifications
You must be signed in to change notification settings - Fork 1
/
.envrc
30 lines (22 loc) · 838 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
use_flake_subdir() {
# Newer versions of direnv have watch_dir but the ancient version in
# Ubuntu does not so we just manually watch all (git-tracked) files.
for file in $(git ls-files nix); do
watch_file $file
done
mkdir -p "$(direnv_layout_dir)"
eval "$(nix print-dev-env --profile "$(direnv_layout_dir)/flake-profile" "path:nix" "$@")"
}
# TODO(#3876) work around for $TMPDIR is removed. #3876 to investigate more
OLD_TMPDIR=$TMPDIR
use flake_subdir
# TODO(#3876) work around for $TMPDIR is removed. #3876 to investigate more
export TMPDIR=$OLD_TMPDIR
source_env .envrc.vars
# Private .envrc
[[ -f .envrc.private ]] && [[ -z "$IGNORE_PRIVATE_ENVRC" ]] && source_env .envrc.private || true
if stat --printf='' .envrc.include.* 2>/dev/null; then
for file in .envrc.include.*; do
source_env $file
done
fi