-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.macos
204 lines (169 loc) · 5.79 KB
/
.macos
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
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Modified by Kent C. Dodds
# And customised by Chris Sowley
# Run without downloading:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/grizzls/dotfiles/master/.macos)"
# 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 &
###############################################################################
# Chris's Customizations #
###############################################################################
echo "Hello $(whoami)! Let's get you set up."
#install Command Line Tools for Xcode
echo "Installing xcode-stuff"
xcode-select --install
read -p "Press [Enter] key after this..."
echo "mkdir -p ${HOME}/code"
mkdir -p "${HOME}/code"
# install homebrew https://brew.sh
if test ! $(which brew); then
echo "installing homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew doctor
echo "installing brew stuff"
#apps for home
home=(
git
openssl
pyenv
pyenv-virtualenv
speedtest-cli
)
homecask=(
1password
docker
google-chrome
iterm2
plex
signal
slack
visual-studio-code
)
#apps for work
work=(
git
helm
kubectx
kubernetes-cli
openssl
pyenv
pyenv-virtualenv
speedtest-cli
sqlite
tfenv
trivy
vault
)
workcask=(
1password
docker
google-cloud-sdk
iterm2
postman
visual-studio-code
)
#apps for media-server
media=(
git
openssl
pyenv
pyenv-virtualenv
)
mediacask=(
google-chrome
iterm2
plex-media-server
sabnzbd
radarr
sonarr
dotnet-sdk
)
# is this a home or work environment
echo "whats the primary use of this install?"
options=("work" "home" "media")
select location in "${options[@]}"
do
case $location in
work ) echo "installing apps with brew cask for work"; brew install ${work[@]}; brew install --cask ${workcask[@]}; break;;
home ) echo "installing apps with brew cask for home"; brew install ${home[@]}; brew install --cask ${homecask[@]}; break;;
media ) echo "installing apps with brew cask for media-server"; brew install ${media[@]}; brew install --cask ${mediacask[@]}; break;;
* ) echo "Choose one of the valid options.";;
esac
done
echo "cleaning up brew"
brew cleanup
# Install Oh My Zsh
echo "installing oh my zsh"
curl -L http://install.ohmyz.sh | sh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
# Install PowerLevel10k Theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k
# Install Powerline fonts
echo "Download the following fonts:"
echo "https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf"
echo "https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf"
echo "https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf"
echo "https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf"
read -p "Press [Enter] key after this..."
# Setting up Python
echo "Cloning xxenv to pyenv plugins"
git clone https://github.com/momo-lab/xxenv-latest.git "$(pyenv root)"/plugins/xxenv-latest
pyenv latest install
pyenv latest global
# GitHub RSA Key
echo "Generating an RSA token for GitHub"
mkdir -p ~/.ssh
ssh-keygen -t rsa -b 4096
echo "Host *\n AddKeysToAgent yes\n UseKeychain yes\n IdentityFile ~/.ssh/id_rsa" | tee ~/.ssh/config
eval "$(ssh-agent -s)"
echo "ssh key ~/.ssh/id_rsa.pub' coppied to clipboard now paste that into GitHub"
echo "https://github.com/account/ssh \n"
pbcopy < ~/.ssh/id_rsa.pub
read -p "Press [Enter] key after this..."
# Clone other dotfiles
echo "cloning dotfiles"
git clone [email protected]:grizzls/dotfiles.git "${HOME}/code/dotfiles"
ln -s "${HOME}/code/dotfiles/.p10k.zsh" "${HOME}/.p10k.zsh"
cp "${HOME}/.zshrc" "${HOME}/.zshrc-backup"
ln -s "${HOME}/code/dotfiles/.zshrc" "${HOME}/.zshrc"
ln -s "${HOME}/code/dotfiles/.zprofile" "${HOME}/.zprofile"
#adding system files to global gitignore
echo "creating global gitignore"
touch "${HOME}/.gitignore_global"
cat >> "${HOME}/.gitignore_global" <<EOL
.DS_Store
*.pyc
.vscode/
EOL
git config --global core.excludesfile "${HOME}/.gitignore_global"
echo "creating .hushlogin"
touch "${HOME}/.hushlogin"
###############################################################################
# System Settings #
###############################################################################
# Show Library folder in Finder
chflags nohidden ~/Library
# Finder: show hidden files by default
#defaults write com.apple.finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
#defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
###############################################################################
# All Done #
###############################################################################
echo "Done!"
printf "
Restart Terminal.app\n\
copy iTerm config from your backup \n\
copy kube config from your backup \n\
login to literally everything \n\
"