{{bash,zsh}rc,profile}: explicitly exclude root from linuxbrew and programming language env tools

This commit is contained in:
Aminda Suomalainen 2026-01-14 09:27:24 +02:00
parent dc663490d9
commit 53da1bbed3
Signed by: Mikaela
GPG Key ID: 99392F62BAE30723
3 changed files with 207 additions and 199 deletions

View File

@ -1,72 +1,74 @@
# This file is a snippet from my {bash,zsh}rc handling both Linuxbrew and if [ "$(id -u)" != "0" ]; then
# different programming language version managers to ensure that when using # This file is a snippet from my {bash,zsh}rc handling both Linuxbrew and
# the former, it will hopefully work for all users. # different programming language version managers to ensure that when using
# # the former, it will hopefully work for all users.
# Dear future me, if you start changing things heavily in one place while not #
# updating the others, consider the traditional resolv.conf chattr +i # Dear future me, if you start changing things heavily in one place while not
# approach. # updating the others, consider the traditional resolv.conf chattr +i
# approach.
# https://github.com/go-nv/goenv # https://github.com/go-nv/goenv
if [ -f /home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv init -)" > /dev/null 2>&1 eval "$(/home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv init -)" > /dev/null 2>&1
PATH=/home/linuxbrew/.linuxbrew/opt/goenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/goenv/bin/shims:$PATH
elif [ -f ~/.goenv/bin/goenv ]; then elif [ -f ~/.goenv/bin/goenv ]; then
eval "$(~/.goenv/bin/goenv init -)" > /dev/null 2>&1 eval "$(~/.goenv/bin/goenv init -)" > /dev/null 2>&1
fi fi
# https://github.com/nvm-sh/nvm # https://github.com/nvm-sh/nvm
if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then
mkdir -p /home/linuxbrew/.nvm mkdir -p /home/linuxbrew/.nvm
export NVM_DIR=/home/linuxbrew/.nvm export NVM_DIR=/home/linuxbrew/.nvm
. /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh . /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh
elif [ -d ~/.nvm ]; then elif [ -d ~/.nvm ]; then
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
. ~/.nvm/bash_completion . ~/.nvm/bash_completion
fi fi
# https://github.com/rbenv/rbenv # https://github.com/rbenv/rbenv
if [ -f /home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH
# No OpenSSL? Remember (and substitute the x, y and z)!: # No OpenSSL? Remember (and substitute the x, y and z)!:
# rbenv install -- --with-openssl-dir=/home/linuxbrew/.linuxbrew/Cellar/openssl@x/x.y.z/ # rbenv install -- --with-openssl-dir=/home/linuxbrew/.linuxbrew/Cellar/openssl@x/x.y.z/
elif [ -f ~/.rbenv/bin/rbenv ]; then elif [ -f ~/.rbenv/bin/rbenv ]; then
eval "$(~/.rbenv/bin/rbenv init -)" eval "$(~/.rbenv/bin/rbenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build # git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
fi fi
# Add RubyGems to PATH # Add RubyGems to PATH
if hash ruby 2> /dev/null; then if hash ruby 2> /dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi fi
# https://github.com/pyenv/pyenv # https://github.com/pyenv/pyenv
if [ -f /home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/pyenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/pyenv/bin/shims:$PATH
elif [ -d ~/.pyenv/bin ]; then elif [ -d ~/.pyenv/bin ]; then
eval "$(~/.pyenv/bin/pyenv init -)" eval "$(~/.pyenv/bin/pyenv init -)"
# Worth considering (and verifying before running) # Worth considering (and verifying before running)
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv # git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper # git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
fi fi
# https://github.com/nodenv/nodenv # https://github.com/nodenv/nodenv
if [ -f /home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/nodenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/nodenv/bin/shims:$PATH
elif [ -d ~/.nodenv/bin/nodenv ]; then elif [ -d ~/.nodenv/bin/nodenv ]; then
eval "$(~/.nodenv/bin/nodenv init -)" eval "$(~/.nodenv/bin/nodenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build # git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
fi fi
# https://github.com/Homebrew/brew # https://github.com/Homebrew/brew
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
# Fedora Atomic compatibility to bypass symlink resolution # Fedora Atomic compatibility to bypass symlink resolution
export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew
fi
fi fi

150
rc/bashrc
View File

@ -265,74 +265,76 @@ export LOCALDOMAIN=.
# regardless of whether DNSSEC=true or not. # regardless of whether DNSSEC=true or not.
export RES_OPTIONS="timeout:1 attempts:5 rotate edns0 trust-ad" export RES_OPTIONS="timeout:1 attempts:5 rotate edns0 trust-ad"
# https://github.com/go-nv/goenv if [ "$(id -u)" != "0" ]; then
if [ -f /home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv ]; then # https://github.com/go-nv/goenv
eval "$(/home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv init -)" > /dev/null 2>&1 if [ -f /home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv ]; then
PATH=/home/linuxbrew/.linuxbrew/opt/goenv/bin/shims:$PATH eval "$(/home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv init -)" > /dev/null 2>&1
elif [ -f ~/.goenv/bin/goenv ]; then PATH=/home/linuxbrew/.linuxbrew/opt/goenv/bin/shims:$PATH
eval "$(~/.goenv/bin/goenv init -)" > /dev/null 2>&1 elif [ -f ~/.goenv/bin/goenv ]; then
fi eval "$(~/.goenv/bin/goenv init -)" > /dev/null 2>&1
fi
# https://github.com/nvm-sh/nvm # https://github.com/nvm-sh/nvm
if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then
mkdir -p /home/linuxbrew/.nvm mkdir -p /home/linuxbrew/.nvm
export NVM_DIR=/home/linuxbrew/.nvm export NVM_DIR=/home/linuxbrew/.nvm
. /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh . /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh
elif [ -d ~/.nvm ]; then elif [ -d ~/.nvm ]; then
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
. ~/.nvm/bash_completion . ~/.nvm/bash_completion
fi fi
# https://github.com/rbenv/rbenv # https://github.com/rbenv/rbenv
if [ -f /home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH
# No OpenSSL? Remember (and substitute the x, y and z)!: # No OpenSSL? Remember (and substitute the x, y and z)!:
# rbenv install -- --with-openssl-dir=/home/linuxbrew/.linuxbrew/Cellar/openssl@x/x.y.z/ # rbenv install -- --with-openssl-dir=/home/linuxbrew/.linuxbrew/Cellar/openssl@x/x.y.z/
elif [ -f ~/.rbenv/bin/rbenv ]; then elif [ -f ~/.rbenv/bin/rbenv ]; then
eval "$(~/.rbenv/bin/rbenv init -)" eval "$(~/.rbenv/bin/rbenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build # git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
fi fi
# Add RubyGems to PATH # Add RubyGems to PATH
if hash ruby 2> /dev/null; then if hash ruby 2> /dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi fi
# https://github.com/pyenv/pyenv # https://github.com/pyenv/pyenv
if [ -f /home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/pyenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/pyenv/bin/shims:$PATH
elif [ -d ~/.pyenv/bin ]; then elif [ -d ~/.pyenv/bin ]; then
eval "$(~/.pyenv/bin/pyenv init -)" eval "$(~/.pyenv/bin/pyenv init -)"
# Worth considering (and verifying before running) # Worth considering (and verifying before running)
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv # git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper # git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
fi fi
# https://github.com/nodenv/nodenv # https://github.com/nodenv/nodenv
if [ -f /home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/nodenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/nodenv/bin/shims:$PATH
elif [ -d ~/.nodenv/bin/nodenv ]; then elif [ -d ~/.nodenv/bin/nodenv ]; then
eval "$(~/.nodenv/bin/nodenv init -)" eval "$(~/.nodenv/bin/nodenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build # git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
fi fi
# https://github.com/Homebrew/brew # https://github.com/Homebrew/brew
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
# Fedora Atomic compatibility to bypass symlink resolution # Fedora Atomic compatibility to bypass symlink resolution
export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew
fi fi
# linuxbrew toolbox compatibility # linuxbrew toolbox compatibility
if [[ -d /run/host/var/home/linuxbrew && ! -d /home/linuxbrew ]]; then if [[ -d /run/host/var/home/linuxbrew && ! -d /home/linuxbrew ]]; then
sudo ln -nsfv /run/host/var/home/linuxbrew /home/linuxbrew sudo ln -nsfv /run/host/var/home/linuxbrew /home/linuxbrew
fi
fi fi
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896 # Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
@ -623,19 +625,21 @@ alias mkdir="\mkdir --verbose"
alias chattr="\chattr -V" alias chattr="\chattr -V"
alias chmod="\chmod --verbose" alias chmod="\chmod --verbose"
# https://github.com/nodejs/corepack/blob/v0.28.2/README.md#corepack-enable--name if [ "$(id -u)" != "0" ]; then
if hash corepack 2> /dev/null; then # https://github.com/nodejs/corepack/blob/v0.28.2/README.md#corepack-enable--name
alias yarn="corepack yarn" if hash corepack 2> /dev/null; then
alias yarnpkg="corepack yarnpkg" alias yarn="corepack yarn"
alias pnpm="corepack pnpm" alias yarnpkg="corepack yarnpkg"
alias pnpx="corepack pnpx" alias pnpm="corepack pnpm"
alias npm="corepack npm" alias pnpx="corepack pnpx"
alias npx="corepack npx" alias npm="corepack npm"
if ! hash prettier 2> /dev/null; then alias npx="corepack npx"
alias prettier="pnpx prettier --cache --ignore-unknown" if ! hash prettier 2> /dev/null; then
alias prettier="pnpx prettier --cache --ignore-unknown"
fi
elif [ "$(id -u)" != "0" ]; then
echo "Information: corepack is not installed."
fi fi
else
echo "Information: corepack is not installed."
fi fi
# https://pnpm.io/installation#using-a-shorter-alias # https://pnpm.io/installation#using-a-shorter-alias

126
rc/zshrc
View File

@ -228,75 +228,77 @@ export LOCALDOMAIN=.
# regardless of whether DNSSEC=true or not. # regardless of whether DNSSEC=true or not.
export RES_OPTIONS="timeout:1 attempts:5 rotate edns0 trust-ad" export RES_OPTIONS="timeout:1 attempts:5 rotate edns0 trust-ad"
# https://github.com/go-nv/goenv if [ "$(id -u)" != "0" ]; then
if [ -f /home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv ]; then # https://github.com/go-nv/goenv
eval "$(/home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv init -)" > /dev/null 2>&1 if [ -f /home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv ]; then
PATH=/home/linuxbrew/.linuxbrew/opt/goenv/bin/shims:$PATH eval "$(/home/linuxbrew/.linuxbrew/opt/goenv/bin/goenv init -)" > /dev/null 2>&1
elif [ -f ~/.goenv/bin/goenv ]; then PATH=/home/linuxbrew/.linuxbrew/opt/goenv/bin/shims:$PATH
eval "$(~/.goenv/bin/goenv init -)" > /dev/null 2>&1 elif [ -f ~/.goenv/bin/goenv ]; then
fi eval "$(~/.goenv/bin/goenv init -)" > /dev/null 2>&1
fi
# https://github.com/nvm-sh/nvm # https://github.com/nvm-sh/nvm
if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then
mkdir -p /home/linuxbrew/.nvm mkdir -p /home/linuxbrew/.nvm
export NVM_DIR=/home/linuxbrew/.nvm export NVM_DIR=/home/linuxbrew/.nvm
. /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh . /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh
elif [ -d ~/.nvm ]; then elif [ -d ~/.nvm ]; then
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
. ~/.nvm/bash_completion . ~/.nvm/bash_completion
fi fi
# https://github.com/rbenv/rbenv # https://github.com/rbenv/rbenv
if [ -f /home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/rbenv/bin/rbenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/rbenv/bin/shims:$PATH
# No OpenSSL? Remember (and substitute the x, y and z)!: # No OpenSSL? Remember (and substitute the x, y and z)!:
# rbenv install -- --with-openssl-dir=/home/linuxbrew/.linuxbrew/Cellar/openssl@x/x.y.z/ # rbenv install -- --with-openssl-dir=/home/linuxbrew/.linuxbrew/Cellar/openssl@x/x.y.z/
elif [ -f ~/.rbenv/bin/rbenv ]; then elif [ -f ~/.rbenv/bin/rbenv ]; then
eval "$(~/.rbenv/bin/rbenv init -)" eval "$(~/.rbenv/bin/rbenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build # git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
fi fi
# Add RubyGems to PATH # Add RubyGems to PATH
if hash ruby 2> /dev/null; then if hash ruby 2> /dev/null; then
PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH" PATH="$(ruby -e 'print Gem.user_dir')/bin:$PATH"
fi fi
# https://github.com/pyenv/pyenv # https://github.com/pyenv/pyenv
if [ -f /home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/pyenv/bin/pyenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/pyenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/pyenv/bin/shims:$PATH
elif [ -d ~/.pyenv/bin ]; then elif [ -d ~/.pyenv/bin ]; then
eval "$(~/.pyenv/bin/pyenv init -)" eval "$(~/.pyenv/bin/pyenv init -)"
# Worth considering (and verifying before running) # Worth considering (and verifying before running)
# git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv # git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
# git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper # git clone https://github.com/pyenv/pyenv-virtualenvwrapper.git $(pyenv root)/plugins/pyenv-virtualenvwrapper
fi fi
# https://github.com/nodenv/nodenv # https://github.com/nodenv/nodenv
if [ -f /home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv ]; then if [ -f /home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv ]; then
eval "$(/home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv init -)" eval "$(/home/linuxbrew/.linuxbrew/opt/nodenv/bin/nodenv init -)"
PATH=/home/linuxbrew/.linuxbrew/opt/nodenv/bin/shims:$PATH PATH=/home/linuxbrew/.linuxbrew/opt/nodenv/bin/shims:$PATH
elif [ -d ~/.nodenv/bin/nodenv ]; then elif [ -d ~/.nodenv/bin/nodenv ]; then
eval "$(~/.nodenv/bin/nodenv init -)" eval "$(~/.nodenv/bin/nodenv init -)"
# Remember! And verify it before running! # Remember! And verify it before running!
# git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build # git clone https://github.com/nodenv/node-build.git "$(nodenv root)"/plugins/node-build
fi fi
# https://github.com/Homebrew/brew # https://github.com/Homebrew/brew
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
# Fedora Atomic compatibility to bypass symlink resolution # Fedora Atomic compatibility to bypass symlink resolution
export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar export HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew export HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew export HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew
fi fi
# linuxbrew toolbox compatibility # linuxbrew toolbox compatibility
if [[ -d /run/host/var/home/linuxbrew && ! -d /home/linuxbrew ]]; then if [[ -d /run/host/var/home/linuxbrew && ! -d /home/linuxbrew ]]; then
sudo ln -nsfv /run/host/var/home/linuxbrew /home/linuxbrew sudo ln -nsfv /run/host/var/home/linuxbrew /home/linuxbrew
fi
fi fi
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896 # Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
@ -622,7 +624,7 @@ if hash corepack 2> /dev/null; then
if ! hash prettier 2> /dev/null; then if ! hash prettier 2> /dev/null; then
alias prettier="corepack pnpx prettier --cache --ignore-unknown" alias prettier="corepack pnpx prettier --cache --ignore-unknown"
fi fi
else elif [ "$(id -u)" != "0" ]; then
echo "Information: corepack is not installed." echo "Information: corepack is not installed."
fi fi