From 12b055790c3e338bddf564be784cc6b329f09f65 Mon Sep 17 00:00:00 2001 From: Texas Toland Date: Fri, 22 Mar 2024 06:42:55 -0500 Subject: [PATCH] Update Nushell integration (#46) * Update Nushell integration Depends on jdx/mise#1763 in release. * Automate reinstallation Manually picked from starship/starship#5845. --- getting-started.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/getting-started.md b/getting-started.md index ce10f8d..36b3bff 100644 --- a/getting-started.md +++ b/getting-started.md @@ -326,12 +326,26 @@ See [`MISE_FISH_AUTO_ACTIVATE=1`](/configuration#mise_fish_auto_activate1) for m #### Nushell +Since Nu does [not support `eval`](https://www.nushell.sh/book/how_nushell_code_gets_run.html#eval-function) the initialization script is saved in `env.nu`: + +```nushell +' +let mise_path = $nu.default-config-dir | path join scripts mise.nu +if $nu.is-interactive { + ^mise activate nu | save $mise_path --force +}' | save $nu.env-path --append +' +if $nu.is-interactive { + use mise.nu +}' | save $nu.config-path --append +``` + +If you prefer to keep your dotfiles clean you can save it to a different directory then update `$env.NU_LIB_DIRS`: + ```nushell -do { - let misepath = ($nu.config-path | path dirname | path join "mise.nu") - run-external mise activate nu --redirect-stdout | save $misepath -f - $"\nsource "($misepath)"" | save $nu.config-path --append -} +' +$env.NU_LIB_DIRS ++= ($mise_path | path dirname | to nuon) +' | save $nu.env-path --append ``` #### Xonsh