-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
96 lines (73 loc) · 1.87 KB
/
bootstrap.sh
File metadata and controls
96 lines (73 loc) · 1.87 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
#!/usr/bin/env bash
set -Eeuo pipefail
# Paths
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
has() {
command -v "$1" >/dev/null 2>&1
}
# System packages
sudo apt-get update
sudo apt-get install -y \
ca-certificates \
curl \
git \
unzip \
build-essential \
pkg-config \
cmake \
software-properties-common \
fontconfig \
stow \
zsh \
fzf \
xclip \
wl-clipboard \
ripgrep \
libclang-dev
# Neovim
if grep -qi ubuntu /etc/os-release; then
sudo add-apt-repository -y ppa:neovim-ppa/unstable
sudo apt-get update
fi
sudo apt-get install -y neovim
# Rust
if ! has rustup; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
source "$HOME/.cargo/env"
rustup default stable
rustup component add rustfmt clippy rust-analyzer
# Tree-sitter CLI
if ! has tree-sitter; then
cargo install tree-sitter-cli --locked
fi
# Starship
mkdir -p "$HOME/.local/bin"
export PATH="$HOME/.local/bin:$PATH"
if ! has starship; then
curl -sS https://starship.rs/install.sh | sh -s -- -y -b "$HOME/.local/bin"
fi
# Font
font_dir="$HOME/.local/share/fonts"
tmp_dir="$(mktemp -d)"
mkdir -p "$font_dir"
curl -fLo "$tmp_dir/JetBrainsMono.zip" \
"https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip"
unzip -o "$tmp_dir/JetBrainsMono.zip" -d "$font_dir" \
"JetBrainsMonoNerdFontMono-Regular.ttf" \
"JetBrainsMonoNerdFontMono-Bold.ttf" \
"JetBrainsMonoNerdFontMono-Italic.ttf" \
"JetBrainsMonoNerdFontMono-BoldItalic.ttf"
fc-cache -fv "$font_dir"
rm -rf "$tmp_dir"
# Dotfiles
cd "$DOTFILES_DIR"
stow --no-folding --target="$HOME" --verbose --simulate .
stow --no-folding --target="$HOME" --verbose .
# Default shell
zsh_path="$(command -v zsh)"
if ! grep -qx "$zsh_path" /etc/shells; then
echo "$zsh_path" | sudo tee -a /etc/shells >/dev/null
fi
chsh -s "$zsh_path"
echo "Done. Restart your terminal."