From 9fe3051c09c621a5ff9be9f2b381448ffa0d1c50 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Sat, 3 Dec 2022 20:46:41 +0000 Subject: [PATCH] Add direnv to nu config --- users/daniel/configs/system/nushell/config.nu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/users/daniel/configs/system/nushell/config.nu b/users/daniel/configs/system/nushell/config.nu index 0750c60..01af66c 100644 --- a/users/daniel/configs/system/nushell/config.nu +++ b/users/daniel/configs/system/nushell/config.nu @@ -282,7 +282,11 @@ let-env config = { hooks: { pre_prompt: [{ - $nothing # replace with source code to run before the prompt is shown + code: " + let direnv = (direnv export json | from json) + let direnv = if ($direnv | length) == 1 { $direnv } else { {} } + $direnv | load-env + " }] pre_execution: [{ $nothing # replace with source code to run before the repl input is run