-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_bashrc
More file actions
54 lines (44 loc) · 1.46 KB
/
dot_bashrc
File metadata and controls
54 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/bash
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# add nix profile to PATH early (so we can find nu)
if [ -d "$HOME/.nix-profile/bin" ]; then
export PATH="$HOME/.nix-profile/bin:$PATH"
fi
# source universal environment setup
if command -v nu > /dev/null && [ -x "$HOME/.local/bin/_env-setup" ]; then
eval "$($HOME/.local/bin/_env-setup bash)"
fi
# add brew shellenv for additional vars (HOMEBREW_PREFIX, etc.)
for brew in /opt/homebrew /home/linuxbrew/.linuxbrew; do
if [ -d $brew ]; then
eval "$(${brew}/bin/brew shellenv)"
fi
done
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
# make bash play dumb unless intentionally launched by user
if [[ "${SSH_CONNECTION}" || "${TERM_PROGRAM}" || "${WSL_DISTRO_NAME}" ]] && tty -s; then
# reset home if WSL or OrbStack launched from windows home
if type -P rg > /dev/null && ([[ "${WSL_DISTRO_NAME}" ]] || echo "$BROWSER" | rg -q orbstack) && echo "$(pwd)" | rg -q "/Users/[^/]+$"; then
cd "$HOME"
fi
# if we've not launched from fish and fish exists, exec fish
if echo "${SHELL}" | grep -q bash && type -P fish > /dev/null; then
exec fish -l
fi
PS1="$(hostname -s)@$(whoami)> "
# hook starship
if tty -s && type starship &> /dev/null; then
eval "$(starship init bash)"
fi
fi