-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmac.sh
More file actions
147 lines (116 loc) · 3.35 KB
/
mac.sh
File metadata and controls
147 lines (116 loc) · 3.35 KB
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
#!/bin/bash
set -ex
quit() {
red=$(tput setaf 1)
reset=$(tput sgr0)
echo " ${red}-- $@${reset}"
exit 1
}
log() {
cyan=$(tput setaf 6)
reset=$(tput sgr0)
echo " ${cyan}-- $@${reset}"
}
curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew=/opt/homebrew/bin/brew
$brew install \
bash \
fzf \
bash-completion@2 \
pyenv \
nvm \
nomad \
neovim \
htop \
nmap \
pyenv \
wget \
1password-cli \
`# For python extensions` \
xz
mkdir ~/.nvm
/opt/homebrew/opt/fzf/install
echo '/opt/homebrew/bin/bash' | sudo tee -a /etc/shells
chsh -s /opt/homebrew/bin/bash zaius
# Use system python
/usr/bin/pip3 install \
black==23.1.0 \
neovim \
`# python-language-server is unmaintained` \
python-lsp-server[all]
/opt/homebrew/bin/pyenv install 3.9.5
/opt/homebrew/bin/pyenv install 3.10.6
mkdir fira
curl --location https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip > fira.zip
unzip -d fira/ fira.zip
rm fira.zip
cp fira/ttf/* /Library/Fonts/
rm -r fira
$brew install \
prettier \
eslint
/opt/homebrew/bin/npm install -g typescript
# Ensure chrome can actually launch
# https://www.reddit.com/r/MacOS/comments/q9d772/homebrew_chromium_is_damaged_and_cant_be_openend/
# https://dev.to/tnzk/install-puppeteer-on-macbook-pro-with-apple-silicon-m1-3kc
$brew install chromium --no-quarantine
defaults write -g ApplePressAndHoldEnabled -bool false
$brew install google-cloud-sdk
#
# pip3 install gcloud gsutil
#
# Git color diffs
$brew install \
git-delta \
libpq
# Avoid wireguard sending all DNS requests via tunnel
# In case wireguard mac ever supports PostUp, injecting the wifi nameservers into the
# wireguard interface would likely be better. Didn't get as far as setting them, but
# this gets them:
# scutil --dns | grep --before 2 'if_index.*en0' | grep nameserver | cut -d ' ' -f 5 | sort | uniq
sudo mkdir -p /etc/resolver
echo nameserver 10.128.0.1 | sudo tee /etc/resolver/prd
echo search prd | sudo tee -a /etc/resolver/prd
echo nameserver 10.128.0.1 | sudo tee /etc/resolver/internal
echo search us-central1-f.c.beyond-pricing-1024.internal | sudo tee -a /etc/resolver/internal
# TODO:
# * wireguard
# * cron
# * orbstack
# * dropbox
# * 1pass
# * firefox
# * rectangle
# * karabiner
# * zoom
# Drag and drop
app_urls=(
'https://updates.helftone.com/monodraw/downloads/monodraw-latest.dmg'
'https://get.videolan.org/vlc/3.0.18/macosx/vlc-3.0.18-arm64.dmg'
'https://github.com/obsidianmd/obsidian-releases/releases/download/v1.2.8/Obsidian-1.2.8-universal.dmg',
# 'https://desktop.docker.com/mac/main/arm64/Docker.dmg'
'https://github.com/qvacua/vimr/releases/download/v0.44.0-20230103.174333/VimR-v0.44.0.tar.bz2'
)
# pkg installers
pkg_urls=(
'https://zoom.us/client/5.13.7.15481/zoomusInstallerFull.pkg?archType=arm64'
)
function install_package() {
tdir='/tmp/install'
mkdir -p $tdir
url=$1
file=`basename $url`
installer=~/Downloads/$file
folder="${tdir}/${file%.*}"
mkdir -p $folder
curl -L -o $installer $url
hdiutil attach "$installer" "-mountpoint" "$folder" || quit "Failed to mount image"
ditto -v `ls -d $folder/*.app` /Applications/
hdiutil detach "$folder"
rm -rf "$folder"
}
for url in ${app_urls[@]}; do
log "Installing: ${url}"
install_package $url
done