-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·218 lines (193 loc) · 6.95 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
#!/usr/bin/env sh
set -e
. /etc/os-release
sudo apt-get update
sudo apt-get dist-upgrade --yes
sudo apt-get install --yes \
asciinema \
atool \
bfs \
btop \
colordiff \
composer \
cowsay \
curl \
dconf-editor \
expect \
fonts-firacode \
fonts-font-awesome \
fonts-hack \
fonts-noto \
fonts-noto-cjk \
fonts-noto-extra \
fzf \
git-extras \
gnome-tweaks \
gnupg2 \
gource \
gpg \
htop \
httpie \
hub \
jq \
make \
net-tools \
nodejs \
npm \
numlockx \
papirus-icon-theme \
php \
polybar \
ripgrep \
rofi \
ruby \
ruby-bundler \
screenfetch \
ssh-audit \
subversion \
tmux \
vim \
wget \
xfce4-screenshooter \
xfce4-terminal \
zsh
# Alacritty
sudo add-apt-repository ppa:aslatter/ppa -y
sudo apt-get update
sudo apt-get install --yes alacritty
# Google Chrome
sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list'
wget -O- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo tee /etc/apt/trusted.gpg.d/linux_signing_key.pub
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 78BD65473CB3BD13
sudo apt-get update
sudo apt-get install --yes google-chrome-stable
# Snap only packages.
# And yes, we have to do this shitty commands chaining because
# snap does not understand having an already installed package
# is not that a deal.
snap list | awk '{print $1}' | grep -q "^discord$" || snap install discord
snap list | awk '{print $1}' | grep -q "^slack$" || snap install slack
snap list | awk '{print $1}' | grep -q "^code$" || snap install --classic code
# Regolith desktop
# https://regolith-desktop.com/#get-regolith-22
wget -qO - https://regolith-desktop.org/regolith.key | \
gpg --dearmor | sudo tee /usr/share/keyrings/regolith-archive-keyring.gpg > /dev/null
echo deb "[arch=amd64 signed-by=/usr/share/keyrings/regolith-archive-keyring.gpg] \
https://regolith-desktop.org/release-3_1-ubuntu-${VERSION_CODENAME}-amd64 ${VERSION_CODENAME} main" | \
sudo tee /etc/apt/sources.list.d/regolith.list
sudo apt-get update
sudo apt-get install --yes \
regolith-desktop \
regolith-session-flashback \
regolith-look-gruvbox \
i3xrocks-keyboard-layout \
i3xrocks-time
# GoLang
wget -O go.tar.gz https://go.dev/dl/go1.21.0.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go.tar.gz
rm -f go.tar.gz
export PATH=$PATH:/usr/local/go/bin
# GHQ
wget -O ghq.zip https://github.com/x-motemen/ghq/releases/download/v1.4.2/ghq_linux_amd64.zip
unzip -o ghq.zip
sudo cp ./ghq_linux_amd64/ghq /usr/local/bin
rm -rf ghq_linux_amd64 ghq.zip
# LAB
# @see https://raw.githubusercontent.com/zaquestion/lab/master/install.sh
# Simplified with locked version
# @see https://github.com/zaquestion/lab/issues/843
latest="0.24.0"
tempFolder="/tmp/lab_v${latest}"
mkdir -p "${tempFolder}" 2> /dev/null
curl -sL "https://github.com/zaquestion/lab/releases/download/v${latest}/lab_${latest}_linux_amd64.tar.gz" | tar -C "${tempFolder}" -xzf -
sudo install -m755 "${tempFolder}/lab" /usr/bin/lab
rm -rf "${tempFolder}"
# Keybase
curl --remote-name https://prerelease.keybase.io/keybase_amd64.deb
sudo apt-get install --yes ./keybase_amd64.deb
rm -f keybase_amd64.deb
# Docker
# @see https://docs.docker.com/engine/install/ubuntu/
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${VERSION_CODENAME} stable"
# @see
sudo mkdir -p /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
sudo apt-get update
sudo apt-get install --yes apt-transport-https ca-certificates curl software-properties-common
sudo apt install docker-ce
sudo usermod --append --groups docker "$(whoami)"
# Podman
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install podman
# Enable rootls podman socket
systemctl --user enable --now podman.socket
git submodule init
git submodule update
git remote set-url origin [email protected]:soullivaneuh/dotfiles.git
CONFIG_PATH="${HOME}/.config"
if [ -d ${CONFIG_PATH} ]; then
mv ${CONFIG_PATH} ${CONFIG_PATH}.back
fi
make deploy init
if [ -d ${CONFIG_PATH}.back ]; then
echo "Backup old .config directory files:"
for file in ${CONFIG_PATH}.back/*; do
basefile=$(basename $file)
echo -n "${basefile} => "
if [ -e ${CONFIG_PATH}/${basefile} ]; then
echo "[EXIST]"
continue
fi
cp --recursive $file ${CONFIG_PATH}
echo "[BACKUP]"
done
fi
keybase login soullivaneuh || true
if [ -z $(gpg --fingerprint --with-colons | grep -o 04460CD228DF9E0D42F07643992EB6FAFD4E6361) ]; then
keybase pgp export | gpg --import
keybase pgp export --secret | gpg --import
./gpg-trust.exp FD4E6361
fi
cd -
sudo ln --force --symbolic /run/user/$(id -u)/keybase/kbfs /keybase || true
# NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash
# RVM
curl -sSL https://get.rvm.io | bash
mkdir --parent --mode=700 "${HOME}/.ssh"
DEPLOY="private/soullivaneuh/deploy"
GHQ_ROOT="${HOME}/p" ghq get keybase://${DEPLOY}
bash "${HOME}/p/${DEPLOY}/deploy.sh"
BIN_PATH="${HOME}/bin"
mkdir --parent ${BIN_PATH}
GIT_SRC="github.com/git/git"
GHQ_ROOT="${HOME}/p" ghq get https://${GIT_SRC}
cd "${HOME}/p/${GIT_SRC}/contrib/diff-highlight" && make && cd -
ln --symbolic --force "${HOME}/p/${GIT_SRC}/contrib/diff-highlight/diff-highlight" "${BIN_PATH}/diff-highlight"
sudo chsh -s /bin/zsh $(whoami)
sudo systemctl enable docker.service
# NTP service for datetime sync.
sudo systemctl enable systemd-timesyncd.service
# Replace default tderminal
# @see https://stackoverflow.com/a/16808639
sudo update-alternatives --set x-terminal-emulator $(which xfce4-terminal).wrapper
echo "Please reboot."