Skip to content

Commit

Permalink
direnv: move DIRENV_ACTIVE var to direnvrc
Browse files Browse the repository at this point in the history
  • Loading branch information
sandydoo committed Dec 27, 2024
1 parent fc5a2d6 commit c48fa1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions direnvrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ _nix_export_or_unset() {
_nix_import_env() {
local profile_rc=$1

# Note which environments are active, but make sure we don't repeat them
if [[ ! "''${DIRENV_ACTIVE-}" =~ (^|:)"$PWD"(:|$) ]]; then
export DIRENV_ACTIVE="$PWD:''${DIRENV_ACTIVE-}"
fi

local old_nix_build_top=${NIX_BUILD_TOP:-__UNSET__}
local old_tmp=${TMP:-__UNSET__}
local old_tmpdir=${TMPDIR:-__UNSET__}
Expand Down
5 changes: 0 additions & 5 deletions src/modules/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,6 @@ in
fi
''}
# note what environments are active, but make sure we don't repeat them
if [[ ! "''${DIRENV_ACTIVE-}" =~ (^|:)"$PWD"(:|$) ]]; then
export DIRENV_ACTIVE="$PWD:''${DIRENV_ACTIVE-}"
fi
# direnv helper
if [ ! type -p direnv &>/dev/null && -f .envrc ]; then
echo "An .envrc file was detected, but the direnv command is not installed."
Expand Down

0 comments on commit c48fa1a

Please sign in to comment.