-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·185 lines (142 loc) · 4.39 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
#!/usr/bin/env bash
set -euo pipefail
function main() {
case $1 in
all)
install_common
install_fish
install_vscode
install_zed
install_python
install_rust
install_nvim
install_apps
install_ui
;;
apps)
install_apps
;;
vscode)
install_vscode
;;
zed)
install_zed
;;
common)
install_common
;;
fish)
install_fish
;;
nvim)
install_nvim
;;
python)
install_python
;;
rust)
install_rust
;;
ui)
install_ui
;;
*)
echo "unknown target to install"
exit 1
;;
esac
echo "Done"
}
function install_common() {
echo "Installing common utilities..."
sudo apt update
sudo apt install -y build-essential curl direnv fonts-firacode httpie git shellcheck jq tldr fd-find
sudo snap install ripgrep --classic
sudo snap alias ripgrep.rg rg
sudo snap install alacritty
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
mkdir -p ~/.local/bin
curl -L https://github.com/zellij-org/zellij/releases/latest/download/zellij-x86_64-unknown-linux-musl.tar.gz --output /tmp/zellij.tar.gz
tar xf /tmp/zellij.tar.gz -C ~/.local/bin
mkdir -p ~/.config/zellij/
ln -s "$(pwd)/zellij.kdl" ~/.config/zellij/config.kdl || true
git clone https://github.com/folke/tokyonight.nvim ~/tokyonight
ln -s "$(which fdfind)" ~/.local/bin/fd || true
ln -s "$(pwd)/gitconfig" ~/.gitconfig || true
mkdir -p ~/.config/alacritty/
ln -s "$(pwd)/alacritty.toml" ~/.config/alacritty/alacritty.toml || true
}
function install_fish() {
echo "Installing and configuring the fish shell..."
sudo apt install -y fish
chsh -s /usr/bin/fish
mkdir -p ~/.config/fish
ln -s "$(pwd)/fish/config.fish" ~/.config/fish/config.fish || true
ln -s "$(pwd)/fish/fish_prompt.fish" ~/.config/fish/functions/fish_prompt.fish || true
echo "You should logout to have the fish shell as the default"
}
function install_python() {
echo "Installing python3..."
sudo apt install -y python3 python3-pip ipython3
curl https://pyenv.run | bash
mkdir -p ~/.ipython/profile_default/startup
ln -s "$(pwd)/ipython/profile_default/startup/00-autoreload.ipy" ~/.ipython/profile_default/startup/00-autoreload.ipy || true
}
function install_rust() {
echo "Installing rust..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup update
}
function install_vscode() {
echo "Installing VSCode..."
sudo snap install code --classic
code \
--install-extension tamasfe.even-better-toml \
--install-extension lunaryorn.fish-ide \
--install-extension ms-python.python \
--install-extension rust-lang.rust \
--install-extension stkb.rewrap \
--install-extension timonwong.shellcheck
mkdir -p ~/.config/Code/User
ln -s "$(pwd)/code/keybindings.json" ~/.config/Code/User/keybindings.json || true
ln -s "$(pwd)/code/settings.json" ~/.config/Code/User/settings.json || true
}
function install_zed() {
echo "Installing Zed..."
curl -f https://zed.dev/install.sh | sh
mkdir -p ~/.config/zed
ln -s "$(pwd)/zed/settings.json" ~/.config/zed/settings.json || true
}
function install_nvim() {
echo "Installing NeoVim..."
sudo snap install nvim
rm -rf ~/.config/nvim.bak
mv ~/.config/nvim ~/.config/nvim.bak || true
mv ~/.local/share/nvim ~/.local/share/nvim.bak || true
mv ~/.local/state/nvim ~/.local/state/nvim.bak || true
mv ~/.cache/nvim ~/.cache/nvim.bak || true
git clone https://github.com/LazyVim/starter ~/.config/nvim
rm -rf ~/.config/nvim/.git
ln -s "$(pwd)/nvim/lua/plugins/mason.lua" ~/.config/nvim/lua/plugins/mason.lua
ln -s "$(pwd)/nvim/lua/plugins/nvim-treesitter.lua" ~/.config/nvim/lua/plugins/nvim-treesitter.lua
ln -s "$(pwd)/nvim/lua/plugins/snacks.lua" ~/.config/nvim/lua/plugins/snacks.lua
ln -sf "$(pwd)/nvim/lua/config/keymaps.lua" ~/.config/nvim/lua/config/keymaps.lua
ln -sf "$(pwd)/nvim/lua/config/options.lua" ~/.config/nvim/lua/config/options.lua
nvim -c "Mason"
nvim -c ':checkhealth'
}
function install_apps() {
echo "Installing miscellaneous apps..."
sudo snap install slack --classic
sudo snap install bitwarden spotify
}
function install_ui() {
echo "customizing ui..."
sudo apt install numix-gtk-theme
gsettings set org.gnome.desktop.interface gtk-theme Numix
}
if [ $# -eq 0 ]; then
echo "Please provide a target to install, use all to install everything"
exit 1
fi
main "$1"