aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/di/direnv/module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/by-name/di/direnv/module.nix')
-rw-r--r--modules/by-name/di/direnv/module.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/by-name/di/direnv/module.nix b/modules/by-name/di/direnv/module.nix
index 4a1a4768..9c2975c3 100644
--- a/modules/by-name/di/direnv/module.nix
+++ b/modules/by-name/di/direnv/module.nix
@@ -53,7 +53,12 @@ in {
end
function _direnv_hook --on-event fish_preexec --on-variable PWD
+ if not set --query IN_DIRENV_SANDBOX; and set --query SHOULD_SANDBOX_DIRENV; and ${direnvPkg} status | grep 'Found RC path' --invert-match | grep 'No .envrc or .env loaded' --quiet
+ # We found a rc path, but none are loaded. So we can start our shell.
+ ${lib.getExe landrun-fish} --interactive --command='_direnv_export_eval'
+ else
_direnv_export_eval
+ end
end
'';