Fedora Silverblue is an immutable operating system, so I try to avoid layering packages onto the host unless they are needed by the system itself. For command-line tools, Toolbx provides a convenient alternative: it gives me a familiar Fedora environment with dnf, while keeping those packages outside the host image.

This post shows how to create a Toolbx container, install Neovim in it, and launch Neovim from the host with a small Zsh alias.

Create a Toolbx container#

Toolbx is included with Fedora Silverblue. Create a container with:

toolbox create neovim

Enter it with:

toolbox enter neovim

Once inside, the prompt changes to show that you are working in the container. The container has access to your home directory, so your projects and configuration files remain available without copying them into the container.

Install Neovim in Toolbx#

Install Neovim using the package manager from inside the Toolbx container:

sudo dnf install -y neovim

Check that the installation completed successfully:

nvim --version

This installs Neovim in the neovim container, not in the immutable Silverblue host. Other command-line tools can be installed in the same way, and can be removed or updated without changing the host image.

Leave the container with exit when you are finished:

exit

Run Neovim from the host#

Toolbx can run a command in a named container without opening an interactive shell. First, check that Neovim works from the host:

toolbox run -c neovim nvim --version

To avoid typing the full command each time, add this alias to ~/.zshrc on the host:

alias nvim='toolbox run -c neovim nvim'

Reload the configuration:

source ~/.zshrc

You can now open a file in the current directory with:

nvim path/to/file

Arguments are passed through to Neovim, so commands such as these work as well:

nvim .
nvim -u NONE path/to/file

Updating the container#

Update the packages in the container whenever needed:

toolbox run -c neovim sudo dnf upgrade

The container is separate from the host deployment, but it is still a normal Fedora environment and should be kept updated. If you no longer need it, remove it with:

toolbox rm neovim

For a list of available containers, use toolbox list.