-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbootstrap.sh
executable file
·229 lines (199 loc) · 6.37 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/usr/bin/env bash
#
# MacOS bootstrapping script
# Luciano Nooijen
#
# Inspiration:
# https://gist.github.com/bradp/bea76b16d3325f5c47d4
# https://gist.github.com/codeinthehole/26b37efa67041e1307db
# https://github.com/fesja/dotfiles/blob/master/.macos
# https://macapps.link
# https://brew.sh
# https://github.com/Homebrew/homebrew-cask-fonts
# Fail on error
set -e
###############################################################################
# Preparation
###############################################################################
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
# sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
# while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
echo "Installing Rosetta"
softwareupdate --install-rosetta --agree-to-license
###############################################################################
# MacOS configuration
###############################################################################
echo "Configuring OSX..."
# Show filename extensions by default
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Disable "natural" scroll
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Set screenshot location
mkdir "$HOME/Desktop/Screenshots" && defaults write com.apple.screencapture location -string "$HOME/Desktop/Screenshots"
# Preventing Time Machine from prompting to use new hard drives as backup volume
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
# Enabling snap-to-grid for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
# Automatically quit printer app once the print jobs complete
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
# Show hidden files
defaults write http://com.apple.Finder AppleShowAllFiles true
# Privacy: don’t send search queries to Apple
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
# Disable hot corners
defaults write com.apple.dock wvous-tl-corner -int 0
defaults write com.apple.dock wvous-tl-modifier -int 0
defaults write com.apple.dock wvous-tr-corner -int 0
defaults write com.apple.dock wvous-tr-modifier -int 0
defaults write com.apple.dock wvous-bl-corner -int 0
defaults write com.apple.dock wvous-bl-modifier -int 0
killall Finder
###############################################################################
# SSH Key and XCode stuff
###############################################################################
echo "Please create an SSH key using the following command:"
echo " ssh-keygen -t rsa -b 4096 -C \"[email protected]\""
read -p "Press [Enter] key after this..."
echo "Installing xcode-stuff"
xcode-select --install
read -p "Press [Enter] when done..."
###############################################################################
# Installations using Homebrew
###############################################################################
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
echo "Updating homebrew..."
brew update
echo "Installing Git via Homebrew..."
brew install git
echo "Please set your Git name and email: "
echo 'git config --global user.name "Name"'
echo 'git config --global user.email [email protected]'
echo "Press any key when done..."
read _
brews=(
ack
ansible
bat
bc
coreutils
deno
docker
docker-compose
exa
fd
ffmpeg
findutils
fzf
go
gnupg
helm
highlight
htop
imagemagick
jq
k9s
kubernetes-cli
lazydocker
lazygit
libpq
minikube
neovim
nmap
pinentry-mac
python
python3
ripgrep
sc-im
speedtest_cli
svn
terraform
the_silver_searcher
thefuck
tmux
tree
wget
youtube-dl
zsh
zsh-syntax-highlighting
)
echo "Installing packages with homebrew..."
brew install ${brews[@]}
casks=(
1password
adobe-acrobat-reader
adobe-creative-cloud
brave-browser
discord
deluge
firefox
flux
jetbrains-toolbox
keka
libreoffice
obs
openvpn-connect
insomnia
iterm2
spotify
signal
slack
sublime-text
tor-browser
visual-studio-code
vlc
whatsapp
zoom
)
# Install apps to /Applications
# Default is: /Users/$user/Applications
echo "installing apps with Cask..."
brew install --cask --appdir="/Applications" ${casks[@]}
echo "Installing fonts..."
brew tap homebrew/cask-fonts
fonts=(
font-dejavu
font-dejavu-sans-mono-for-powerline
font-dejavu-sans-mono-nerd-font
font-menlo-for-powerline
font-lato
font-roboto
font-clear-sans
)
brew install --cask ${fonts[@]}
echo "Cleaning up Homebrew..."
brew cleanup
###############################################################################
# Installations that require user input
###############################################################################
echo "This might need some attention from you for input:"
echo "Installing NodeJS stuff..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
echo "Installing rustup..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
###############################################################################
# Finished
###############################################################################
echo "Done!"
echo "Now install the following by hand:"
echo " - Software using the Jetbrains Toolbox"
echo " - Software using the Adobe Creative Cloud tool"
echo " - Postgres.app (https://postgresapp.com/downloads.html)"
echo " - Your desired NodeJS version using nvm"
echo " - Logitech Options from logitech.com"
echo " - Docker Desktop app"
echo " - Software from the Mac App Store and such"
echo " - Your custom dotfiles"
echo "But first, restart your computer!"