-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bash
More file actions
executable file
·203 lines (157 loc) · 5.06 KB
/
setup.bash
File metadata and controls
executable file
·203 lines (157 loc) · 5.06 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
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
#!/bin/bash
set -e
ROOTPATH=$(dirname $(realpath "$0"))
CONFIGPATH=$ROOTPATH/config
dnfcoprs=(
erikreider/SwayNotificationCenter
)
dnfpackages=(
SwayNotificationCenter
alacritty
firefox
flatpak
git
golang
htop
hyprland
jq
kitty
neovim
net-tools
network-manager-applet
python3
python3-neovim
ripgrep
rsync
waybar
wget
wireguard-tools
zsh
)
flatpackages=(
com.spotify.Client
flathub
org.telegram.desktop
)
gomodes=(
github.com/cweill/gotests/...@latest
github.com/davidrjenni/reftools/cmd/fillstruct@latest
github.com/fatih/gomodifytags@latest
github.com/godoctor/godoctor@latest
github.com/haya14busa/gopkgs/cmd/gopkgs@latest
github.com/josharian/impl@latest
github.com/mdempsky/gocode@latest
github.com/rogpeppe/godef@latest
github.com/zmb3/gogetdoc@latest
golang.org/x/tools/cmd/godoc@latest
golang.org/x/tools/cmd/goimports@latest
golang.org/x/tools/cmd/gorename@latest
golang.org/x/tools/cmd/guru@latest
)
fonts_hack_version=v3.1.1
installdnf () {
echo "[INFO] dnf: installing RPM fusion"
sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
echo "[INFO] dnf: RPM fusion installed"
sudo dnf upgrade -y
echo "[INFO] dnf: installing copr repositories"
sudo dnf copr enable -y "${dnfcoprs[@]}"
echo "[INFO] dnf: copr repositories installed"
echo "[INFO] dnf: installing packages"
sudo dnf install -y "${dnfpackages[@]}"
echo "[INFO] dnf: done"
}
installflatpaks() {
echo "[INFO] flatpak: installing flathub repository"
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
echo "[INFO] flatpak: flathub installed"
echo "[INFO] flatpak: installing packages"
flatpak install -y "${flatpackages[@]}"
echo "[INFO] flatpak: done"
}
installomz() {
echo "[INFO] omz: installing"
[[ -x $HOME/.oh-my-zsh ]] || ZSH= sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "[INFO] omz: installed"
echo "[INFO] omz: changing shell to zsh"
sudo usermod -s $(which zsh) $USER
echo "[INFO] omz: downloading themes"
rm -rf /tmp/simplerich
mkdir -p ~/.oh-my-zsh/themes/
git clone --recursive https://github.com/philip82148/simplerich-zsh-theme /tmp/simplerich
cp -f /tmp/simplerich/simplerich.zsh-theme ~/.oh-my-zsh/themes/simplerich.zsh-theme
echo "[INFO] omz: done"
}
installfonts() {
echo "[INFO] fonts: installing"
echo "[INFO] fonts: installing Hack Nerd Font Mono"
wget https://github.com/ryanoasis/nerd-fonts/releases/download/${fonts_hack_version}/Hack.tar.xz -O /tmp/hack.tar.xz
mkdir -p ~/.local/share/fonts/hack-nerd-font
tar -xf /tmp/hack.tar.xz -C ~/.local/share/fonts/hack-nerd-font
echo "[INFO] fonts: done"
}
installneovim() {
echo "[INFO] neovim: bootstrapping config..."
mkdir -p ~/.config/nvim
git clone https://github.com/homier/kickstart.nvim ~/.config/nvim || \
echo "[INFO] nvim: dotfiles are already present"
cd ~/.config/nvim \
&& git stash \
&& git pull --rebase \
|| git stash pop \
|| cd $ROOTPATH
echo "[INFO] nvim: done"
}
installrust() {
echo "[INFO] rust: installing"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
$HOME/.cargo/bin/rustup update
$HOME/.cargo/bin/rustup component add rust-analyzer
echo "[INFO] rust: done"
}
installgo() {
echo "[INFO] go: installing modules"
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install golang.org/x/tools/gopls@latest
for module in ${gomodes[@]}
do
go install $module
done
echo "[INFO] go: adding GOPATH to environment"
grep -qxF 'export GOPATH="$HOME/go"' ~/.zshenv || echo 'export GOPATH="$HOME/go"' >> ~/.zshenv
grep -qxF 'export PATH=$PATH:$GOPATH/bin' ~/.zshenv || echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.zshenv
echo "[INFO] go: done"
}
configs() {
echo "[INFO] configs: applying $HOME/.config"
rsync -a $CONFIGPATH/ $HOME/.config
echo "[INFO] configs: applying zsh config"
cp -a $ROOTPATH/zshrc $HOME/.zshrc
echo "[INFO] configs: done"
}
configuresystemd() {
echo "[INFO] systemd: enabling services"
systemctl enable --now --user gpg-agent
systemctl enable --now --user ssh-agent
systemctl enable --now --user plasma-polkit-agent
echo "[INFO] systemd: done"
}
configuregit() {
echo "[INFO] git: applying global configs"
git config --global user.name "Dzmitry Mikhalapau"
git config --global user.email "dzmitry.mikhalapau@gmail.com"
git config --global commit.gpgsign true
git config --global core.editor vim
echo "[INFO] git: done"
}
installdnf
installflatpaks
installfonts
installomz
installrust
installgo
installneovim
configs
configuresystemd
configuregit