Skip to content

Commit 49be3c8

Browse files
authored
[devbox] add .envrc file to repo (#899)
## Summary - enable us to use direnv in the repo ## How was it tested? enabled direnv as per: https://direnv.net/docs/hook.html verified via: ``` ~/code/jetpack on ☁️ (us-east-2) on ☁️ [email protected] ❯ cd devbox direnv: loading ~/code/jetpack/devbox/.envrc direnv: using devbox direnv: using nix .devbox/gen/shell.nix direnv: ([/usr/local/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up. this path will be fetched (1.05 MiB download, 6.52 MiB unpacked): /nix/store/vsm70r60gfg7bkzcyybm932qfc3cirl9-bash-interactive-5.2-p15 copying path '/nix/store/vsm70r60gfg7bkzcyybm932qfc3cirl9-bash-interactive-5.2-p15' from 'https://cache.nixos.org'... direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DEVBOX_OG_PATH +DEVBOX_SHELL_ENABLED +GETTEXTDATADIRS +HOST_PATH +IN_NIX_SHELL +LD +LD_DYLD_PATH +LD_LIBRARY_PATH +LIBRARY_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_apple_darwin +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_COREFOUNDATION_RPATH +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_NO_SELF_RPATH +NIX_STORE +NM +PATH_LOCALE +RANLIB +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +XDG_DATA_DIRS +__DEVBOX_SHELLENV_HASH +__ETC_PROFILE_NIX_SOURCED +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~TMPDIR ❯ cd .. direnv: unloading ```
1 parent dd47088 commit 49be3c8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.envrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Automatically sets up your devbox environment whenever you cd into this
2+
# directory via our direnv integration:
3+
4+
use_devbox() {
5+
watch_file devbox.json
6+
if [ -f .devbox/gen/shell.nix ]; then
7+
DEVBOX_SHELL_ENABLED_BACKUP=$DEVBOX_SHELL_ENABLED
8+
use nix .devbox/gen/shell.nix
9+
eval $(devbox shell --print-env)
10+
export DEVBOX_SHELL_ENABLED=$DEVBOX_SHELL_ENABLED_BACKUP
11+
fi
12+
}
13+
use devbox
14+
15+
# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
16+
# for more details

0 commit comments

Comments
 (0)