forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.envrc
More file actions
40 lines (34 loc) · 1.66 KB
/
.envrc
File metadata and controls
40 lines (34 loc) · 1.66 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
if [ -n "${AVALANCHEGO_DIRENV_USE_FLAKE}" ]; then
if ! command -v nix > /dev/null; then
echo "To enable entering a dev shell via this .envrc: ./scripts/run_task.sh install-nix"
else
# nix-direnv speeds up flake evaluation vs the built-in direnv support
# due to caching and the avoidance of nix garbage collection.
if ! has nix_direnv_version; then
source "$(nix build nixpkgs#nix-direnv --no-link --print-out-paths)/share/nix-direnv/direnvrc"
fi
use flake
fi
fi
# Repo-local commands like ginkgo and tmpnetctl
PATH_add bin
# Configure the explicit built path of avalanchego for tmpnet usage
export AVALANCHEGO_PATH="${AVALANCHEGO_PATH:-$PWD/bin/avalanchego}"
# Configure the local plugin directory for both avalanchego and tmpnet usage
mkdir -p $PWD/build/plugins # avalanchego will FATAL if the directory does not exist
export AVAGO_PLUGIN_DIR="${AVAGO_PLUGIN_DIR:-$PWD/build/plugins}" # Use an existing value if set
# Default to tmpnetctl targeting the last deployed tmpnet network
export TMPNET_NETWORK_DIR="${TMPNET_NETWORK_DIR:-${HOME}/.tmpnet/networks/latest}"
# Allow individuals to add their own customisation
source_env_if_exists .envrc.local
# Allow individuals to add global customization without requiring .envrc.local files in each one
#
# Example usage:
#
# - Add to shell profile (~/.bashrc, ~/.zshrc, etc.)
#
# export GLOBAL_ENVRC="$HOME/.envrc_global"
#
export ENVRC_GIT_REPO=avalanchego # Enables configuring the global behavior by repo
export ENVRC_PROJECT_DIR="$PWD" # Enables targeting the current project directory
[[ -n "$GLOBAL_ENVRC" ]] && source_env_if_exists "$GLOBAL_ENVRC"