-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap.zsh
executable file
·160 lines (133 loc) · 4.33 KB
/
bootstrap.zsh
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
#!env zsh
err() { echo -e "\n! $*" >&2 }
log() { echo -e "# $*" >&2 }
[[ "$(uname)" == "Darwin" ]] && {
err "Not on macOS, quitting"
exit -1
}
echo " hi"
log "save current settings"; {
defaults read >! defaults-$(date +%s)
}
log "set hostname to talon"; {
scutil --set ComputerName talon
scutil --set LocalHostName talon
}
log "closing system preferences to avoid conflicts"; {
osascript -e 'tell application "System Preferences" to quit'
}
log "enable control+scroll zooming"; {
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
}
log "autohide and empty dock"; {
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock persistent-apps -array ""
killall Dock > /dev/null 2>&1
}
log "set Keyboard caps lock to control"; {
defaults -currentHost write -globalDomain -array \
'{ HIDKeyboardModifierMappingDst = 30064771300; HIDKeyboardModifierMappingSrc = 30064771129; }'
}
log "enable tap-to-click"; {
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -int 1
defaults write com.apple.AppleMultitouchTrackpad Clicking -int 1
}
log "update system software"; {
softwareupdate --install --all
}
log "install homebrew"; {
(( $+commands[brew] )) || {
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
grep --quiet homebrew ~/.zprofile || echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
grep HOMEBREW_NO_ENV_HINTS ~/.zprofile || echo 'export HOMEBREW_NO_ENV_HINTS=true' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
}
brew analytics off
}
log "install rustup"; {
(( $+commands[rustup] )) || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}
log "block ad domains in /private/etc/hosts"; {
grep --quiet StevenBlack /private/etc/hosts || {
curl 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts' \
--append --output /private/etc/hosts
}
}
log "install shell apps"; {
cargo install zr
brew install fd fzf gh helix daxartio/tap/kdbx monitorcontrol mpv node podman podman-compose rg syncthing tldr zig zoxide
brew install aws-cli git-lfs typescript-language-server qt@5 vscode-langservers-extracted
git lfs install
}
log "install desktop apps"; {
brew install around discord firefox protonmail-bridge signal tidal
brew install citrix-workspace
}
log "clone dotfiles"; {
test -f ~/.dotfiles || git clone https://github.com/jedahan/dotfiles ~/.dotfiles
}
log "enable containers"; {
podman machine init
podman machine start
}
log "install llms"; {
brew install ollama llm
ollama pull qwen2.5-coder:32b
llm install llm-ollama
}
log "disable studentd"; {
launchctl disable system/studentd
killall studentd
launchctl disable system/com.apple.ManagedClient.enroll
}
log "block mdm hosts"; {
grep --quiet 'block mdm' || {
echo <<MDM
# block mdm
0.0.0.0 iprofiles.apple.com
0.0.0.0 deviceenrollment.apple.com
0.0.0.0 mdmenrollment.apple.com
0.0.0.0 gdmf.apple.com
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com
MDM | sudo tee -a /etc/hosts
}
}
log "print instructions for disabling mdm"; {
log <<CLOUD
reboot to recovery by holding down power until options show up
menu -> utilities -> terminal, then run the following:
cd /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings
mv .cloudConfigHasActivationRecord .cloudConfigHasActivationRecord.bak
mv .cloudConfigRecordFound .cloudConfigRecordFound.bak
touch .cloudConfigProfileInstalled
touch .cloudConfigRecordNotFound
CLOUD
}
log "print firefox manual steps"; {
echo <<FIREFOX
- install iCloud Passwords addon
- install Kagi search
- install uBlock Origin, Privacy Badger, ClearURLs, Facebook Container
- remove amazon, bing, google from search shortcuts
- remove search suggesstions from firefox or sponsors
- switch search engine to kagi
- remove sponsored links from start page
- set start page background to fox in snow
- remove shortcuts from start page
FIREFOX
}
log "print manual steps"; {
echo <<TODO
- turn on apple private relay
- login to github
- install ghostty
- transfer ssh keys from old laptop
- create 'work' user or learn to use spaces
- symlink dotfiles
TODO
}
log "enable services that require manual interaction"; {
brew services start syncthing
}
echo " bye"