devbox global add ripgrep
. Now whenever you start a Devbox shell, you will have
ripgrep available, even if it’s not in the project’s devbox.json.
Installing Packages with Devbox Global
devbox global
to replace package managers like brew
and apt
by adding the
global profile to your path. Because Devbox uses Nix to install packages, you can sync your global
config to install the same packages on any machine.
Devbox saves your global config in a devbox.json
file in your home directory. This file can be
shared with other users or checked into source control to synchronize it across machines.
Adding and Managing Global Packages
You can install a package usingdevbox global add [<package>]
, where the package names should be a
list of Nix Packages you want to install.
For example, if we wanted to install ripgrep, vim, and git to our global profile, we could run:
devbox.json
.
To view a full list of global packages, you can run devbox global list
:
Using Global Packages in your Host Shell
If you want to make your global packages available in your host shell, you can add them to your shell PATH. Runningdevbox global shellenv
will print the command necessary to source the
packages.
Add Global Packages to your Current Host Shell
To temporarily add the global packages to your current shell, run:Bash
Add the following command to your~/.bashrc
file:
Zsh
Add the following command to your~/.zshrc
file:
Fish
Add the following command to your~/.config/fish/config.fish
file:
Sharing Your Global Config with Git
You can use Git to synchronize yourdevbox global
config across multiple machines using
devbox global push <remote>
and devbox global pull <remote>
.
Your global devbox.json
and any other files in the Git remote will be stored in
$XDG_DATA_HOME/devbox/global/default
. If $XDG_DATA_HOME
is not set, it will default to
~/.local/share/devbox/global/default
. You can view the current global directory by running
devbox global path
.
Next Steps
Learn more about Devbox
- Getting Started: Learn how to install Devbox and create your first Devbox Shell.
- Devbox Scripts: Automate setup steps and configuration for your shell using Devbox Scripts.
- Configuration Guide: Learn how to configure your shell and dev
environment with
devbox.json
. - Browse Examples: You can see how to create a development environment for your favorite tools or languages by browsing the Devbox Examples repo.
- Using Flakes with Devbox: Learn how to install packages from Nix Flakes.
Use Devbox with your IDE
- Direnv Integration: Devbox can integrate with direnv to automatically activate your shell and packages when you navigate to your project.
- Devbox for Visual Studio Code: Install our VS Code extension to speed up common Devbox workflows or to use Devbox in a devcontainer.
Get Involved
- Join our Discord Community: Chat with the development team and our growing community of Devbox users.
- Visit us on Github: File issues and provide feedback, or even open a PR to contribute to Devbox or our Docs.