Last active
May 28, 2025 09:15
-
-
Save rgielen/73533fcb210ca7c0bfa65e1f1d9e44aa to your computer and use it in GitHub Desktop.
Install devbox for a Linux user with global support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -L https://gist.github.com/rgielen/73533fcb210ca7c0bfa65e1f1d9e44aa/raw/09ce13bfdf98b6a6b01a9080280bddafa906e9d4/install-devbox.sh | bash -