-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·419 lines (359 loc) · 10.7 KB
/
setup.sh
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
initial_folder="$(pwd)"
export HOME="/home/thiago"
export UBUNTU_CODENAME="jammy"
export CC="gcc-10"
mkdir -p "$HOME/.dotfiles"
mkdir -p "$HOME/bin"
mkdir -p "$HOME/src"
mkdir -p "$HOME/dev/finbits"
mkdir -p "$HOME/dev/thiamsantos"
mkdir -p "$HOME/.docker/cli-plugins"
mkdir -p "$HOME/.config/doom"
mkdir -p "$HOME/.config/rofi"
mkdir -p "$HOME/.config/alacritty"
mkdir -p "$HOME/.config/i3status-rust"
mkdir -p "$HOME/.config/i3"
mkdir -p "$HOME/.config/dunst"
mkdir -p "$HOME/.zsh_functions"
mkdir -p "$HOME/.zsh_cache/completions"
mkdir -p "$HOME/.terraform.d/plugin-cache"
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/keyrings/1password-archive-keyring.gpg --yes
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/1password-archive-keyring.gpg] https://downloads.1password.com/linux/debian/amd64 stable main' | sudo tee /etc/apt/sources.list.d/1password.list
sudo mkdir -p /etc/debsig/policies/AC2D62742012EA22/
curl -sS https://downloads.1password.com/linux/debian/debsig/1password.pol | sudo tee /etc/debsig/policies/AC2D62742012EA22/1password.pol
sudo mkdir -p /usr/share/debsig/keyrings/AC2D62742012EA22
curl -sS https://downloads.1password.com/linux/keys/1password.asc | sudo gpg --dearmor --output /usr/share/debsig/keyrings/AC2D62742012EA22/debsig.gpg --yes
curl -sS https://download.spotify.com/debian/pubkey_6224F9941A8AA6D1.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg
echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg --yes
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc
do
sudo apt-get remove --yes $pkg
done
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$UBUNTU_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list
apt remove --purge --yes libreoffice*
apt autoclean
apt autopurge
apt autoremove
apt update
apt upgrade -y
apt install -y \
1password \
autoconf \
bison \
blueman \
bluez \
bluez-tools \
build-essential \
ca-certificates \
cheese \
chromium-browser \
cmake \
compton \
containerd.io \
cowsay \
curl \
direnv \
docker-buildx-plugin \
docker-ce \
docker-ce-cli \
docker-compose-plugin \
dunst \
editorconfig \
fd-find \
ffmpeg \
flameshot \
flatpak \
fonts-font-awesome \
fop \
fzf \
gcc \
gcc-10 \
git \
groff \
i3 \
imagemagick \
inotify-tools \
jq \
libcurl4-openssl-dev \
libdb-dev \
libexif-dev \
libffi-dev \
libfontconfig1-dev \
libfreetype6-dev \
libgccjit-10-dev \
libgccjit0 \
libgdbm-dev \
libgdbm6 \
libgif-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libgnutls28-dev \
libgtk-3-dev \
libgtk2.0-dev \
libharfbuzz-bin \
libharfbuzz-dev \
libimlib2-dev \
libjansson-dev \
libjansson4 \
libjpeg-dev \
libmagickwand-dev \
libncurses-dev \
libncurses5-dev \
libnotmuch-dev \
libpipewire-0.3-dev \
libpng-dev \
libpq-dev \
libpulse-dev \
libpulse0 \
libreadline6-dev \
libsensors-dev \
libssh-dev \
libssl-dev \
libtest-command-perl \
libtest-simple-perl \
libtiff-dev \
libtiff5-dev \
libwxgtk3.0-gtk3-dev \
libx11-dev \
libxcb-screensaver0 \
libxcb-screensaver0-dev \
libxcb-xfixes0-dev \
libxcb1 \
libxcb1-dev \
libxinerama-dev \
libxkbcommon-dev \
libxml2-utils \
libxpm-dev \
libxss-dev \
libxss1 \
libxt-dev \
libyaml-dev \
lxappearance \
m4 \
make \
openjdk-11-jdk \
pandoc \
pkg-config \
playerctl \
postgresql-client \
python3 \
python3-pip \
python3-venv \
rofi \
scrot \
shellcheck \
silversearcher-ag \
spotify-client \
stow \
terraform \
texinfo \
tidy \
unixodbc-dev \
unzip \
vim \
vim-gtk \
vlc \
wget \
xaw3dg-dev \
xclip \
xsltproc \
zlib1g-dev \
zsh \
# TODO: stop using flatpak
flatpak install -y flathub org.ferdium.Ferdium
flatpak install -y flathub us.zoom.Zoom
if [ ! -d "$HOME/.cargo/bin" ]
then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
. "$HOME/.cargo/env"
rustup override set stable
rustup update stable
emacs_folder="$HOME/src/emacs"
if [ ! -d "$emacs_folder" ]
then
git clone --depth 1 --branch emacs-29.3 git://git.savannah.gnu.org/emacs.git $emacs_folder
fi
if ! [ -x "$(command -v emacs)" ]
then
cd $emacs_folder
./autogen.sh
./configure --with-native-compilation --with-json
make -j$(nproc)
sudo make install
cd "$initial_folder"
fi
feh_folder="$HOME/src/feh"
if [ ! -d "$feh_folder" ]
then
git clone https://github.com/derf/feh.git $feh_folder
fi
if ! [ -x "$(command -v feh)" ]
then
cd $feh_folder
make
sudo make install app=1
cd "$initial_folder"
fi
if ! [ -x "$(command -v greenclip)" ]
then
wget https://github.com/erebe/greenclip/releases/download/v4.2/greenclip --directory-prefix "$HOME/bin"
sudo chmod +x "$HOME/bin/greenclip"
fi
alacritty_folder="$HOME/src/alacritty"
if [ ! -d "$alacritty_folder" ]
then
git clone https://github.com/alacritty/alacritty.git $alacritty_folder
fi
alacritty_release_folder="$HOME/src/alacritty/target/release/alacritty"
if [ ! -e "$alacritty_release_folder" ]
then
cd $alacritty_folder
cargo build --release && sudo tic -xe alacritty,alacritty-direct extra/alacritty.info
cd "$initial_folder"
fi
ln -sf "$HOME/src/alacritty/target/release/alacritty" "$HOME/bin/alacritty"
if [ ! -e "/usr/share/applications/Alacritty.desktop" ]
then
cd $alacritty_folder
sudo cp extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg
sudo desktop-file-install extra/linux/Alacritty.desktop
sudo update-desktop-database
cd "$initial_folder"
fi
if [ ! -e "/usr/local/share/man/man1/alacritty.1.gz" ]
then
cd $alacritty_folder
sudo mkdir -p /usr/local/share/man/man1
sudo mkdir -p /usr/local/share/man/man5
scdoc < extra/man/alacritty.1.scd | gzip -c | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
scdoc < extra/man/alacritty-msg.1.scd | gzip -c | sudo tee /usr/local/share/man/man1/alacritty-msg.1.gz > /dev/null
scdoc < extra/man/alacritty.5.scd | gzip -c | sudo tee /usr/local/share/man/man5/alacritty.5.gz > /dev/null
scdoc < extra/man/alacritty-bindings.5.scd | gzip -c | sudo tee /usr/local/share/man/man5/alacritty-bindings.5.gz > /dev/null
cd "$initial_folder"
fi
ln -sf "$HOME/src/alacritty/extra/completions/_alacritty" "$HOME/.zsh_functions/_alacritty"
asdf_folder="$HOME/.asdf"
if [ ! -d "$asdf_folder" ]
then
git clone https://github.com/asdf-vm/asdf.git $asdf_folder --branch v0.14.0
fi
. $asdf_folder/asdf.sh
if [ ! -d "$asdf_folder/plugins/nodejs" ]
then
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
fi
if [ ! -d "$asdf_folder/plugins/yarn" ]
then
asdf plugin add yarn
fi
if [ ! -d "$asdf_folder/plugins/erlang" ]
then
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
fi
if [ ! -d "$asdf_folder/plugins/elixir" ]
then
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
fi
if [ ! -d "$asdf_folder/plugins/rust" ]
then
asdf plugin-add rust https://github.com/asdf-community/asdf-rust.git
fi
asdf plugin update --all
if ! [ -x "$(command -v node)" ]
then
asdf install nodejs 18.12.1
asdf global nodejs 18.12.1
fi
if ! [ -x "$(command -v yarn)" ]
then
asdf install yarn 1.22.19
asdf global yarn 1.22.19
fi
if ! [ -x "$(command -v erl)" ]
then
asdf install erlang 26.2.1
asdf global erlang 26.2.1
fi
if ! [ -x "$(command -v elixir)" ]
then
asdf install elixir 1.16.0-otp-26
asdf global elixir 1.16.0-otp-26
fi
sudo groupadd -f docker
sudo usermod -aG docker "$USER"
antigen_folder="$HOME/src/antigen"
if [ ! -d "$antigen_folder" ]
then
git clone https://github.com/zsh-users/antigen.git $antigen_folder
fi
dracula_highlighting="$HOME/src/dracula-zsh-syntax-highlighting"
if [ ! -d "$dracula_highlighting" ]
then
git clone https://github.com/dracula/zsh-syntax-highlighting.git $dracula_highlighting
fi
stow --verbose --target=$HOME git zsh asdf vim
stow --verbose --target="$HOME/bin" bin
stow --verbose --target="$HOME/.config/doom" doom
stow --verbose --target="$HOME/.config/rofi" rofi
stow --verbose --target="$HOME/.config/alacritty" alacritty
stow --verbose --target="$HOME/.config/dunst" dunst
stow --verbose --target="$HOME/.config/i3status-rust" i3status-rust
stow --verbose --target="$HOME/.config/i3" i3
stow --verbose --target="$HOME/.config" greenclip
stow --verbose --target="$HOME/.ssh" ssh
doom_emacs_folder="$HOME/.config/emacs"
if [ ! -d "$doom_emacs_folder" ]
then
git clone --depth 1 https://github.com/doomemacs/doomemacs $doom_emacs_folder
$doom_emacs_folder/bin/doom install
fi
aws_download_folder="/tmp/awscliv2"
if ! [ -x "$(command -v aws)" ]
then
mkdir -p $aws_download_folder
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "$aws_download_folder/awscliv2.zip"
unzip "$aws_download_folder/awscliv2.zip" -d $aws_download_folder
$aws_download_folder/aws/install --bin-dir "$HOME/bin" --install-dir "$HOME/src/aws-cli"
rm -rf $aws_download_folder
fi
sudo chsh -s /bin/zsh thiago
cargo install tlrc
cargo install git-delta
cargo install xidlehook --bins
i3status_rust_folder="$HOME/src/i3status-rust"
if [ ! -d "$i3status_rust_folder" ]
then
git clone https://github.com/greshake/i3status-rust $i3status_rust_folder
fi
if [ ! -e "$HOME/.cargo/bin/i3status-rs" ]
then
cd $i3status_rust_folder
cargo install --path . --locked
./install.sh
cd "$initial_folder"
fi
ripgrep_folder="$HOME/src/ripgrep"
if [ ! -d "$ripgrep_folder" ]
then
git clone https://github.com/BurntSushi/ripgrep $ripgrep_folder
fi
if [ ! -e "$HOME/.cargo/bin/rg" ]
then
cargo install --path $ripgrep_folder --features 'pcre2'
fi
pip3 install isort pipenv pytest nose
npm -g install js-beautify stylelint
ln -sf "$HOME/dev/finbits/hammer/target/release/ham" "$HOME/bin/ham"