-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap.sh
165 lines (139 loc) · 3.38 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
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
#!/bin/zsh
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twditter (app store)
# - Postgres.app (http://postgresapp.com/)
#
# Notes:
#
# - If installing full Xcode, it's better to install that first from the app
# store before running the bootstrap script. Otherwise, Homebrew can't access
# the Xcode libraries as the agreement hasn't been accepted yet.
#
# Reading:
#
# - http://lapwinglabs.com/blog/hacker-guide-to-setting-up-your-mac
# - https://gist.github.com/MatthewMueller/e22d9840f9ea2fee4716
# - https://news.ycombinator.com/item?id=8402079
# - http://notes.jerzygangi.com/the-best-pgp-tutorial-for-mac-os-x-ever/
echo "Starting bootstrapping"
# Check for Oh My Zsh, install if we don't have it
if ! type omz > /dev/null
then
echo "Installing Oh My Zsh..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
# Update Oh My Zsh
omz update
# Check for Homebrew, install if we don't have it
if ! type brew > /dev/null
then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Update homebrew recipes
brew update
PACKAGES=(
awscli
azure-cli
git
kubernetes-cli
markdown
node
npm
nvim
nvm
postgresql
python
python3
rabbitmq
serve
the_silver_searcher
tmux
vercel-cli
zsh-git-prompt
zsh-syntax-highlighting
)
echo "Installing packages..."
brew install ${PACKAGES[@]}
echo "Cleaning up..."
brew cleanup
echo "Installing cask..."
brew tap homebrew/cask
CASKS=(
# adobe-creative-cloud
arduino
authy
blender
discord
docker
dropbox
firefox
# google-chrome
google-cloud-sdk
google-drive
iterm2
# microsoft-teams
obs
protonvpn
slack
spectacle
spotify
steam
visual-studio-code
vlc
vmware-fusion
vmware-horizon-client
)
echo "Installing cask apps..."
brew install ${CASKS[@]}
echo "Installing fonts..."
brew tap homebrew/cask-fonts
FONTS=(
font-fira-code
font-fira-mono
font-fira-sans
font-clear-sans
)
brew install ${FONTS[@]}
if ! which pip3 > /dev/null
then
echo "Installing pip..."
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
fi
echo "Installing Python packages..."
PYTHON_PACKAGES=(
virtualenv
virtualenvwrapper
)
sudo pip3 install ${PYTHON_PACKAGES[@]}
echo "Installing global npm packages..."
GLOBAL_NPM_PACKAGES=(
yarn
)
npm install ${GLOBAL_NPM_PACKAGES[@]} -g
echo "Configuring OSX..."
# Set host name
sudo scutil --set HostName MBP21
# Show filename extensions by default
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# TODO: Remap CAPS_LOCK to ESC
echo "Installing Vim plugins..."
vim +'PlugInstall --sync' +qa
echo "Configuring iTerm2..."
# TODO: Add iterm2 settings plist to dotfiles project
# Overwrite ~/Library/Prferences/com.googlecode.iterm2.plist
echo "Configuring VSCode..."
# TODO: Add vscode settings to dotfiles project
echo "Creating folder structure..."
[[ ! -d Code ]] && mkdir Code
echo "Bootstrapping complete 🤙"