-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.bashrc
More file actions
162 lines (138 loc) · 5.02 KB
/
.bashrc
File metadata and controls
162 lines (138 loc) · 5.02 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# GitLab CI Local completions
###-begin-gitlab-ci-local-completions-###
_gitlab-ci-local_yargs_completions() {
local cur_word args type_list
cur_word="${COMP_WORDS[COMP_CWORD]}"
args=("${COMP_WORDS[@]}")
type_list=$(gitlab-ci-local --get-yargs-completions "${args[@]}")
COMPREPLY=( $(compgen -W "${type_list}" -- "${cur_word}") )
if [ ${#COMPREPLY[@]} -eq 0 ]; then
COMPREPLY=()
fi
return 0
}
complete -o bashdefault -o default -F _gitlab-ci-local_yargs_completions gitlab-ci-local
###-end-gitlab-ci-local-completions-###
# Use 1Password SSH agent (if available)
[[ -S ~/.1password/agent.sock ]] && export SSH_AUTH_SOCK=~/.1password/agent.sock
# Set GOPATH
export GOPATH=$HOME/go
# Set WIN_IP from resolv.conf
export WIN_IP=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf)
export BUN_INSTALL="$HOME/.bun"
# Add custom paths to PATH
paths_to_add=(
"$HOME/.local/bin"
"$HOME/.local/share/pnpm"
"$HOME/.pulumi/bin"
"${KREW_ROOT:-$HOME/.krew}/bin"
"$HOME/.linkerd2/bin"
"/usr/local/go/bin"
"$GOPATH/bin"
"$HOME/.cargo/bin"
"/snap/bin"
"$HOME/.dotfiles/bin"
"$BUN_INSTALL/bin"
)
for path in "${paths_to_add[@]}"; do
if [[ ":$PATH:" != *":$path:"* ]]; then
export PATH="$PATH:$path"
fi
done
# Homebrew
if [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"
fi
# Ensure /usr/local/bin takes precedence over Homebrew
export PATH="/usr/local/bin:$PATH"
# Configure no_proxy for Kubernetes
if [[ ":$no_proxy:" != *":kubernetes.docker.internal:"* ]]; then
export no_proxy="$no_proxy,kubernetes.docker.internal"
fi
# Disable update prompts
export DISABLE_UPDATE_PROMPT=true
# Set DISPLAY for WSL X11
# --- WSL-only DISPLAY setup (safe with/without WSLg) ---
is_wsl() {
# True if running under WSL1/WSL2
grep -qiE 'microsoft|wsl' /proc/sys/kernel/osrelease 2>/dev/null
}
if is_wsl; then
# Don’t override when using ssh -X/-Y inside WSL
if [ -z "$SSH_CONNECTION" ]; then
# If WSLg is present, DISPLAY/WAYLAND are already set correctly
if [ -d /mnt/wslg ] || [ -n "$WAYLAND_DISPLAY" ]; then
: # do nothing – WSLg handles DISPLAY/Wayland
else
# Legacy X server on Windows (VcXsrv/X410/etc.)
host_ip="$(awk '/^nameserver /{print $2; exit}' /etc/resolv.conf 2>/dev/null)"
if [ -n "$host_ip" ] && { [ -z "$DISPLAY" ] || echo "$DISPLAY" | grep -qE '^(|127\.)'; }; then
export DISPLAY="${host_ip}:0"
# Optional: helps some OpenGL-on-WSL1 setups
export LIBGL_ALWAYS_INDIRECT=1
fi
fi
fi
fi
# --- end WSL-only block ---
# Source FZF
source ~/.fzf.bash
# Initialize NVM (Node Version Manager)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# Export private GitLab settings
export GOPRIVATE=gitlab-ncsa.ubisoft.org
# Set GPG_TTY
export GPG_TTY=$(tty)
# Source user-defined aliases
source ~/.bash_aliases
# Initialize direnv (auto-load .envrc on cd)
if command -v direnv >/dev/null 2>&1; then
eval "$(direnv hook bash)"
fi
# Initialize Starship prompt (only in interactive, real terminals)
if [[ $- == *i* ]] && [[ -t 1 ]] && [[ "${TERM:-}" != "dumb" ]]; then
eval "$(starship init bash)"
fi
export PYTHONUTF8=1
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# pnpm
export PNPM_HOME="/home/paul/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# BEGIN ANSIBLE MANAGED BLOCK
# Created by markosamuli.gcloud Ansible role
if [ -d "$HOME/google-cloud-sdk" ]; then
export CLOUDSDK_ROOT_DIR="$HOME/google-cloud-sdk"
# Update PATH for the Google Cloud SDK.
source $CLOUDSDK_ROOT_DIR/path.bash.inc
# Enable bash completion for gcloud.
source $CLOUDSDK_ROOT_DIR/completion.bash.inc
fi
# END ANSIBLE MANAGED BLOCK
# GVM — use $HOME so this works for any user (root, paul, etc.)
# GVM scripts reference ZSH_VERSION, GVM_NO_GIT_BAK, gvm_go_name, and
# GVM_DEBUG without defaults, so we must guard all of them and temporarily
# disable nounset (-u) around the source since we can't patch every file.
if [[ -s "$HOME/.gvm/scripts/gvm" ]]; then
export GVM_DEBUG="${GVM_DEBUG:-}"
export GVM_NO_GIT_BAK="${GVM_NO_GIT_BAK:-}"
# gvm's scripts/function/_bash_pseudo_hash uses $HEXDUMP_PATH (and friends)
# without sourcing scripts/function/tools, so on every cd it tries to run
# the literal `-e` as a command and floods stderr with
# `-e: command not found`. Pre-export the paths to silence it.
export LS_PATH="${LS_PATH:-$(command -v ls)}"
export TR_PATH="${TR_PATH:-$(command -v tr)}"
export SED_PATH="${SED_PATH:-$(command -v sed)}"
export GREP_PATH="${GREP_PATH:-$(command -v grep)}"
export EGREP_PATH="${EGREP_PATH:-$(command -v egrep)}"
export SORT_PATH="${SORT_PATH:-$(command -v sort)}"
export HEAD_PATH="${HEAD_PATH:-$(command -v head)}"
export HEXDUMP_PATH="${HEXDUMP_PATH:-$(command -v hexdump)}"
_gvm_prev_opts="$(set +o)"; set +u
source "$HOME/.gvm/scripts/gvm"
eval "$_gvm_prev_opts"; unset _gvm_prev_opts
fi