-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-osx.sh
97 lines (82 loc) · 2.22 KB
/
install-osx.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
#!/usr/bin/env bash
#
# 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:
#
# - Twitter (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 Homebrew, install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Update homebrew recipes
brew update
PACKAGES=(
git
zsh
nginx
php
mysql
mysql@5.7
node
nvm
yarn
dnsmasq
zsh-autosuggestions
zsh-syntax-highlighting
)
echo "Installing packages..."
brew install ${PACKAGES[@]}
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
CASKS=(
alfred
docker
notion
firefox
google-chrome
iterm2
phpstorm
postman
rocket-chat
skype
slack
telegram-desktop
visual-studio-code
)
echo "Installing cask apps..."
brew cask install ${CASKS[@]}
echo "Installing fonts..."
brew tap homebrew/cask-fonts
FONTS=(
font-firacode-nerd-font
)
brew cask install ${FONTS[@]}
echo "Configuring OSX..."
ln -s ~/Documents/.ssh ~/
# Require password as soon as screensaver or sleep mode starts
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
# Show filename extensions by default
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Disable "natural" scroll
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
echo "Bootstrapping complete"