-
Notifications
You must be signed in to change notification settings - Fork 0
/
.install
201 lines (179 loc) · 4.92 KB
/
.install
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
function confirm() {
local prompt=$1
local default_prompt="Are you sure"
read -p "${prompt:-$default_prompt}? " -n 1 -r
echo;
if [[ $REPLY =~ ^[Yy]$ ]]
then
return 0
else
return 1
fi
}
function _source_bashrc() {
. "$HOME/.bashrc"
}
function _install_brew_packages() {
if [[ uname == "Darwin" ]];then
brew install -q git make unzip wget moreutils zip bash-completion binutils coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep openssh
brew install -q --cask alacritty
fi
# Docker
brew install -q \
lazydocker \
docker \
docker-completion \
docker-buildx
# Terraform
brew install -q \
tflint \
tfenv \
terraform-docs
# Python
brew install -q \
pyenv \
poetry \
pipx \
pyenv \
pipx \
pyenv-virtualenv
# Markdown
brew install -q \
glow \
vale
# AWS
brew install -q \
awscli \
aws-sam-cli \
aws-vault
# Kubernetes
brew install -q \
kubectl
# Vim
brew install -q \
fzf \
neovim \
ctags \
ripgrep \
fd \
jsonlint \
yaml-language-server \
tree-sitter
# TS/JS
brew install -q \
pnpm
# Go
brew install -q \
goenv
# Rust
brew install -q \
rustup
# Ruby
brew install -q \
rbenv
# Others
brew install -q \
gcc \
moreutils \
tmux \
gh \
spaceship \
zsh \
go-task \
pre-commit
}
function _install_brew() {
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
}
function _install_deps() {
if type apt 2>/dev/null;then
sudo apt update
sudo apt upgrade -y
sudo apt-get remove -y --purge 'vim*'
sudo apt install -y sudo build-essential curl git wget zip unzip bash-completion procps openssh-client locales
if [[ "$WSL_DISTRO_NAME" == "Ubuntu" ]];then
. /etc/os-release
# Starting from Ubuntu 22.04 LTS, Ubuntu on WSL no longer bundled with wslu. Please install the PPA version.
if [[ "$VERSION_ID" == "22.04" ]];then
sudo apt install ubuntu-wsl -y
sudo add-apt-repository ppa:wslutilities/wslu -y
sudo apt update
sudo apt install wslu -y
fi
elif [[ "$WSL_DISTRO_NAME" == "Debian" ]];then
sudo apt install gnupg2 apt-transport-https -y
wget -O - https://pkg.wslutiliti.es/public.key | sudo tee /etc/apt/trusted.gpg.d/wslu.asc
echo "deb https://pkg.wslutiliti.es/debian $(. /etc/os-release && echo "$VERSION_CODENAME") main" | sudo tee /etc/apt/sources.list.d/wslu.list
sudo apt update
sudo apt install wslu -y
fi
elif [[ uname == "Darwin" ]];then
xcode-select --install
fi
}
function _install_nvm() {
curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR=~/.nvm
[ -s $NVM_DIR/nvm.sh ] && . $NVM_DIR/nvm.sh # This loads nvm
[ -s $NVM_DIR/bash_completion ] && . $NVM_DIR/bash_completion # This loads nvm bash_completion
nvm install --lts --latest-npm
source <(npm completion)
}
function _install_cspell() {
echo Installing cspell
npm install -g cspell
if [ -L ~/.local/bin/cspell ];then
rm -f ~/.local/bin/cspell
fi
ln -s $(which cspell) ~/.local/bin/cspell
}
function _install_aws_azure_login() {
echo Installing aws-azure-login
npm install -g aws-azure-login
if [ -L ~/.local/bin/aws-azure-login ];then
rm -f ~/.local/bin/aws-azure-login
fi
ln -s $(which aws-azure-login) ~/.local/bin/aws-azure-login
}
function _install_alacrity_support() {
echo Installing Alacritty
wget -q https://github.com/alacritty/alacritty/releases/latest/download/alacritty.bash -O $HOME/.local/share/bash-completion/alacritty.bash
chmod +x $HOME/.local/share/bash-completion/alacritty.bash
curl -L -s https://github.com/alacritty/alacritty/releases/latest/download/alacritty.info | sudo tic -xe alacritty,alacritty-direct -
infocmp alacritty 2>&1 >/dev/null
}
function _configure_nvim() {
echo Configuring NeoVim
nvim +PlugInstall +qall
}
function _start_ssh_agent() {
echo startup ssh agent
/usr/bin/ssh-agent -s > ~/.agent;
}
function _configure_locale() {
echo Generating locale
bash -c 'sudo locale-gen $LANG'
}
function _install_nvshim() {
pipx install git+https://github.com/iamogbz/nvshim.git
}
function _install_tmux_completions() {
wget -O $HOME/.local/share/bash-completion/tmux.bash https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux
chmod +x $HOME/.local/share/bash-completion/tmux.bash
}
function _install_adr_tools() {
if [[ ! -e ~/.local/src/adr-tools ]]; then
git clone https://github.com/npryce/adr-tools.git \
~/.local/src/adr-tools
fi
git -C ~/.local/src/adr-tools pull
}
# Not in the install.sh
function _install_krew_df_pv() {
curl https://krew.sh/df-pv | bash
}
function _install_bash_it() {
if [[ ! -d ~/.bash_it ]];then
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
fi
}