Skip to content

Instantly share code, notes, and snippets.

@rgielen
Last active May 28, 2025 09:15
Show Gist options
  • Select an option

  • Save rgielen/73533fcb210ca7c0bfa65e1f1d9e44aa to your computer and use it in GitHub Desktop.

Select an option

Save rgielen/73533fcb210ca7c0bfa65e1f1d9e44aa to your computer and use it in GitHub Desktop.
Install devbox for a Linux user with global support
#! /bin/bash
add_devbox_shellenv() {
local target_file="$1"
if [ -f "$target_file" ]; then
grep -qxF 'eval "$(~/.nix-profile/bin/devbox global shellenv)"' "$target_file" || echo 'eval "$(~/.nix-profile/bin/devbox global shellenv)"' >> "$target_file"
fi
}
curl -L https://nixos.org/nix/install | sh -s -- --no-daemon --yes
nix-env -iA nixpkgs.devbox
eval "$(devbox global shellenv --preserve-path-stack -r)" && hash -r
add_devbox_shellenv "$HOME/.bashrc"
add_devbox_shellenv "$HOME/.zshrc"
@rgielen
Copy link
Author

rgielen commented May 28, 2025

curl -L https://gist.github.com/rgielen/73533fcb210ca7c0bfa65e1f1d9e44aa/raw/09ce13bfdf98b6a6b01a9080280bddafa906e9d4/install-devbox.sh | bash -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment