-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·152 lines (134 loc) · 2.4 KB
/
bootstrap.sh
File metadata and controls
executable file
·152 lines (134 loc) · 2.4 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
#!/usr/bin/env bash
set -euo pipefail
DOTFILES_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
info() {
printf '==> %s\n' "$*"
}
has() {
command -v "$1" >/dev/null 2>&1
}
install_fedora() {
local packages=(
bat
curl
direnv
eza
fd-find
fzf
git
gnupg2
lazygit
neovim
nodejs
npm
cargo
python3-neovim
R-core
ripgrep
starship
stow
tmux
zathura
latexmk
zoxide
zsh
)
info "Installing packages with dnf"
sudo dnf install -y "${packages[@]}"
}
install_ubuntu() {
local packages=(
bat
curl
direnv
fd-find
fzf
git
gnupg
lazygit
neovim
nodejs
npm
cargo
python3-neovim
r-base
ripgrep
stow
tmux
zathura
latexmk
zoxide
zsh
)
info "Installing packages with apt"
sudo apt-get update
sudo apt-get install -y "${packages[@]}"
if ! has starship; then
info "Installing starship to ~/.local/bin"
curl -fsSL https://starship.rs/install.sh | sh -s -- --bin-dir "$HOME/.local/bin" --yes
fi
if ! has eza; then
info "eza is not available from the default apt packages on every Ubuntu release"
info "Install it from your distribution, cargo, or https://github.com/eza-community/eza"
fi
}
install_arch() {
local packages=(
bat
curl
direnv
eza
fd
fzf
git
gnupg
lazygit
neovim
nodejs
npm
cargo
python-pynvim
r
ripgrep
starship
stow
tmux
zathura
texlive-binextra
zoxide
zsh
)
info "Installing packages with pacman"
sudo pacman -Syu --needed "${packages[@]}"
}
install_packages() {
if has dnf; then
install_fedora
elif has apt-get; then
install_ubuntu
elif has pacman; then
install_arch
else
info "No supported package manager found. Install packages manually, then rerun stow."
fi
}
install_antidote() {
if [[ -r "$HOME/.antidote/antidote.zsh" ]]; then
info "Antidote already installed"
return
fi
info "Installing Antidote"
git clone --depth=1 https://github.com/mattmc3/antidote.git "$HOME/.antidote"
}
stow_dotfiles() {
info "Stowing dotfiles"
stow --dir "$DOTFILES_DIR" --target "$HOME" zsh aliases git nvim
}
main() {
install_packages
install_antidote
stow_dotfiles
info "Bootstrap complete"
info "Set zsh as your login shell with: chsh -s \"$(command -v zsh)\""
}
main "$@"