Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Update Nushell integration
Browse files Browse the repository at this point in the history
Depends on jdx/mise#1763 in release.
  • Loading branch information
texastoland committed Mar 16, 2024
1 parent 4ce8ab4 commit 75bb6b2
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ this uses `~/.local/bin/mise` as the binary location since that's what https://m
installed mise by some other means it may be on PATH or somewhere different.

::: code-group

```sh [bash]
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
```

```sh [zsh]
echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc
```

```sh [fish]
echo '~/.local/bin/mise activate fish | source' >> ~/.config/fish/config.fish
```

:::

### 2b. Alternative: Add mise shims to PATH
Expand All @@ -55,12 +59,15 @@ mise in interactive sessions (.bash_profile/.zprofile will work in non-interacti
like scripts or IDEs).

::: code-group

```sh [bash]
echo 'export PATH="$HOME/.local/share/mise/shims:$PATH"' >> ~/.bash_profile
```

```sh [zsh]
echo 'export PATH="$HOME/.local/share/mise/shims:$PATH"' >> ~/.zprofile
```

```sh [fish]
fish_add_path ~/.local/share/mise/shims
```
Expand Down Expand Up @@ -112,6 +119,7 @@ curl https://mise.run | sh
```

Options:

- `MISE_DEBUG=1` – enable debug logging
- `MISE_QUIET=1` – disable non-error output
- `MISE_INSTALL_PATH=/some/path` – change the binary path (default: `~/.local/bin/mise`)
Expand All @@ -128,18 +136,23 @@ sh ./install.sh
or if you're allergic to `| sh`:

::: code-group

```sh [macos-arm64]
curl https://mise.jdx.dev/mise-latest-macos-arm64 > ~/.local/bin/mise
```

```sh [macos-x64]
curl https://mise.jdx.dev/mise-latest-macos-x64 > ~/.local/bin/mise
```

```sh [linux-x64]
curl https://mise.jdx.dev/mise-latest-linux-x64 > ~/.local/bin/mise
```

```sh [linux-arm64]
curl https://mise.jdx.dev/mise-latest-linux-arm64 > ~/.local/bin/mise
```

:::

It doesn't matter where you put it. So use `~/bin`, `/usr/local/bin`, `~/.local/bin` or whatever.
Expand Down Expand Up @@ -175,6 +188,7 @@ _mise lives in the [community repository](https://gitlab.alpinelinux.org/alpine/
For installation on Ubuntu/Debian:

::: code-group

```sh [amd64]
apt update -y && apt install -y gpg sudo wget curl
sudo install -dm 755 /etc/apt/keyrings
Expand All @@ -192,6 +206,7 @@ echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=arm64] http
sudo apt update
sudo apt install -y mise
```

:::

### aur
Expand Down Expand Up @@ -326,12 +341,24 @@ 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) you must save the activation script:

```nushell
let mise_path = $nu.default-config-dir | path join scripts mise.nu
^mise activate nu | save $mise_path --force
"\nuse mise.nu" | save $nu.config-path --append
```

If you prefer to keep your dotfiles clean you can save it to another directory then update `$env.NU_LIB_DIRS`:

```nushell
"\n$env.NU_LIB_DIRS ++= ($mise_path | path dirname | to nuon)" | save $nu.env-path --append
```

You can update the generated script at any time by re-running:

```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
}
^mise activate nu | save $mise_path --force
```

#### Xonsh
Expand Down

0 comments on commit 75bb6b2

Please sign in to comment.