-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.sh
executable file
·217 lines (196 loc) · 5.69 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
#!/usr/bin/env bash
set -euo pipefail
# NOTE:
# For convience,
# Make passwordless sudo possible via
# sudo visudo
# and add the following line to the end of the file
# <username> ALL=(ALL) NOPASSWD: ALL
#
# INFO:
# If you happen to be a vim user,
# you can replace the default editor with vim
# sudo update-alternatives --config editor
# before editing the sudoers file
# Neovim release tag to install
NEOVIM_RELEASE_TAG="v0.10.0"
# Shazam release tag to install
SHAZAM_RELEASE_TAG="v1.0.0"
# Go version to install
GO_VERSION="1.22.4"
sudo apt update
sudo apt install -y \
bat \
build-essential \
cargo \
curl \
curl \
direnv \
eza \
fd-find \
flameshot \
fuse3 \
fzf \
gcc \
gnome \
gnome-shell-extension-manager \
htop \
jq \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
llvm \
lua5.4 \
luarocks \
make \
make \
net-tools \
pipx \
python3-openssl \
ripgrep \
shellcheck \
tk-dev \
tmux \
touchegg \
wget \
xz-utils \
zlib1g-dev \
zsh
# Install Go
if [ -f /usr/local/go/bin/go ] && [ "$(go version | awk '{print $3}')" = "go$GO_VERSION" ]; then
echo "📦 Go already installed"
echo "💡 Skipping Go installation"
else
if [ -f /usr/local/go/bin/go ]; then
echo "📌 Go already installed but not the required version"
echo "🧹 Removing the existing Go installation"
rm -rf /usr/local/go
fi
wget https://golang.org/dl/go$GO_VERSION.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz
rm go$GO_VERSION.linux-amd64.tar.gz
fi
# Install fonts
FONTS_INSTALLED=0
if [ ! -d ~/.local/share/fonts ]; then
mkdir -p ~/.local/share/fonts
fi
if [ -f ~/.local/share/fonts/FiraCodeNerdFont-Regular.ttf ]; then
echo "📦 FiraCodeNerdFont already installed"
echo "💡 Skipping FiraCode installation"
else
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/FiraCode.zip
unzip FiraCode.zip -d ~/.local/share/fonts
rm ~/.local/share/fonts/*.md
rm ~/.local/share/fonts/LICENSE*
rm FiraCode.zip
FONTS_INSTALLED=1
fi
if [ -f ~/.local/share/fonts/VictorMonoNerdFont-Regular.ttf ]; then
echo "📦 VictorMonoNerdFont already installed"
echo "💡 Skipping VictorMono installation"
else
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/VictorMono.zip
unzip VictorMono.zip -d ~/.local/share/fonts
rm ~/.local/share/fonts/*.md
rm ~/.local/share/fonts/LICENSE*
rm VictorMono.zip
FONTS_INSTALLED=1
fi
if [ $FONTS_INSTALLED -eq 1 ]; then
fc-cache -f -v
fi
# Install wezterm
if [ -f /usr/bin/wezterm ]; then
echo "📦 wezterm already installed"
echo "💡 Skipping wezterm installation"
else
curl -fsSL https://apt.fury.io/wez/gpg.key | sudo gpg --yes --dearmor -o /usr/share/keyrings/wezterm-fury.gpg
echo 'deb [signed-by=/usr/share/keyrings/wezterm-fury.gpg] https://apt.fury.io/wez/ * *' | sudo tee /etc/apt/sources.list.d/wezterm.list
sudo apt update
sudo apt install wezterm
fi
# Install Google Chrome
if [ -f /usr/bin/google-chrome ]; then
echo "📦 Google Chrome already installed"
echo "💡 Skipping Google Chrome installation"
else
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
rm google-chrome-stable_current_amd64.deb
fi
# tmux plugin manager install
if [ -d ~/.tmux/plugins/tpm ]; then
echo "📦 tmux plugin manager already installed"
echo "💡 Skipping tmux plugin manager installation"
else
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
# Install Neovim
if [ -f /usr/bin/nvim ]; then
echo "📦 Neovim already installed"
echo "💡 Skipping Neovim installation"
else
wget https://github.com/neovim/neovim/releases/download/$NEOVIM_RELEASE_TAG/nvim.appimage
chmod +x nvim.appimage
sudo mv nvim.appimage /usr/bin/nvim
fi
# Install pyenv
if [ -d ~/.pyenv ]; then
echo "📦 pyenv already installed"
echo "💡 Skipping pyenv installation"
else
curl https://pyenv.run | bash
fi
# Install bun
if [ -d ~/.bun ]; then
echo "📦 bun already installed"
echo "💡 Skipping bun installation"
else
curl -fsSL https://bun.sh/install | bash
fi
# Install shazam.sh and symlink dotfiles
if [ -f /usr/bin/shazam ]; then
echo "📦 shazam.sh already installed"
echo "💡 Skipping shazam.sh installation"
else
wget "https://github.com/mistweaverco/shazam.sh/releases/download/$SHAZAM_RELEASE_TAG/shazam-linux"
chmod +x shazam-linux
sudo mv shazam-linux /usr/bin/shazam
fi
# Symlink dotfiles
shazam
# Ensure $HOME/.local/bin directory exists
if [ ! -d ~/.local/bin ]; then
mkdir -p ~/.local/bin
fi
# Make zsh the default shell
if [ "$SHELL" = "/bin/zsh" ]; then
echo "📦 zsh already the default shell"
echo "💡 Skipping zsh default shell setup"
else
chsh -s "$(which zsh)"
fi
# Install Docker
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
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
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo groupadd docker
sudo usermod -aG docker "$USER"
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
sudo systemctl start docker.service