-
Notifications
You must be signed in to change notification settings - Fork 3
/
bootstrap.sh
executable file
·139 lines (112 loc) · 3.05 KB
/
bootstrap.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
#!/usr/bin/env bash
#
# I use the script as a reference for bootstrapping my development environment
# on new (Mac) computers. I generally don't run it directly since it gets outdated quickly
# and there's always commands that will fail and need to be updated.
# Exit if anything fails.
set -e
# Match hidden files with "*"
shopt -s dotglob
#A##########
# Homebrew #
############
# Install Homebrew if not yet installed.
if ! hash brew 2>/dev/null; then
echo "Installing homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Make sure we’re using the latest Homebrew.
brew update
# Upgrade any already-installed formula.
brew upgrade
# Install dependencies.
brew install \
coreutils \
moreutils \
findutils \
gnu-sed \
fish \
wget \
python3 \
tmux \
reattach-to-user-namespace \
fzf \
go \
git-crypt \
mosh \
gnupg \
pngpaste \
yazi
# Install nightly neovim.
brew install --HEAD neovim
# Install NERDFont
brew tap homebrew/cask-fonts
brew install --cask font-dejavu-sans-mono-nerd-font
# Use homebrew-installed Python by default.
brew link python
##################
# Rust toolchain #
##################
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Rust tools.
cargo install sccache \
bat \
ripgrep \
fd-find \
sd \
du-dust \
bottom \
zoxide \
starship \
exa
##############################################
# Install configuration files (as symlinks). #
##############################################
mkdir -p ~/.config
mkdir -p ~/.virtualenvs
# tmux.
for filename in ~/dotfiles/tmux/.tmux*; do
ln -sf $filename ~/
done
mkdir ~/.tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Neovim.
mkdir -p ~/.config/nvim
for filename in ~/dotfiles/neovim/*; do
ln -sf $filename ~/.config/nvim/$(basename $filename)
done
# Fish.
mkdir -p ~/.config/fish
for filename in ~/dotfiles/fish/*; do
ln -sf $filename ~/.config/fish/$(basename $filename)
done
# Go.
for filename in ~/dotfiles/go/.*; do
ln -sf $filename ~/
done
# Alacritty.
mkdir -p ~/.config/alacritty
ln -sf ~/dotfiles/alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml
#git clone https://github.com/catppuccin/alacritty.git ~/.config/alacritty/catppuccin
# Starship.
ln -sf ~/dotfiles/starship/starship.toml ~/.config/starship.toml
# Global Python requirements.
ln -sf ~/dotfiles/requirements.txt ~/.virtualenvs/global_requirements.txt
# Git.
git config --global user.name "epwalsh"
git config --global user.email "[email protected]"
echo ".venv" >> ~/.gitignore
git config --global core.excludesFile "$HOME/.gitignore"
########################
# Change shell to Fish #
########################
echo $(which fish) | sudo tee -a /etc/shells
chsh -s $(which fish)
#######################
# Python environments #
#######################
# Set up virtualfish.
pip3 install virtualfish
vf install global_requirements auto_activation
ln -sf ~/dotfiles/requirements.txt ~/.virtualenvs/global_requirements.txt
vf new base