-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·152 lines (121 loc) · 4.11 KB
/
setup.sh
File metadata and controls
executable file
·152 lines (121 loc) · 4.11 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
148
149
150
151
152
#!/usr/bin/env bash
read -p "ℹ️ Grant Terminal Full Disk Access in System Preferences > Security & Privacy > Privacy..."
if [[ $(uname -m) == 'arm64' ]]; then
softwareupdate --install-rosetta --agree-to-license
PREFIX=/opt/homebrew
else
PREFIX=/usr/local
fi
PATH=$PREFIX/bin:$PATH
BIN_PATH=$PREFIX/bin
OPT_PATH=$PREFIX/opt
# SSH key
if [[ ! -f "~/.ssh/id_rsa.pub" ]]; then
ssh-keygen -t rsa
echo "ℹ️ Please add this public key to GitHub: https://github.com/account/ssh"
cat ~/.ssh/id_rsa.pub
echo
fi
# Xcode
xcode-select --install
# Homebrew
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Log in to the App Store
open -a "App Store"
read -p "ℹ️ Log in to the App Store and press any key..."
# Install Casks that require a password
brew install --cask docker zoom
# Install Brews, Casks and MAS apps
brew install mas
brew bundle
# Setup version manager
source $OPT_PATH/asdf/libexec/asdf.sh
# Install Python
asdf plugin-add python
PYTHON3_VERSION=$(asdf list-all python | grep -v '[a-z]' | grep '^3' | tail -1)
asdf install python $PYTHON3_VERSION
asdf global python $PYTHON3_VERSION
# Install Poetry
asdf plugin-add poetry
POETRY_VERSION=$(asdf list-all poetry | tail -1)
asdf install poetry $POETRY_VERSION
# Install Kubectl
asdf plugin-add kubectl
KUBECTL_VERSION=$(asdf list-all kubectl | tail -1)
asdf install kubectl $KUBECTL_VERSION
# Install Terraform
asdf plugin-add terraform
TERRAFORM_VERSION=$(asdf list-all terraform | grep -v '[a-z]' | tail -1)
asdf install terraform $TERRAFORM_VERSION
# Install Rust
asdf plugin-add rust
RUST_VERSION=$(asdf list-all rust | grep -v '[a-z]' | tail -1)
asdf install rust $RUST_VERSION
# Install packages
pip3 install pylint
# Rust
sudo mkdir /opt/cargo && sudo chown jacek:admin /opt/cargo
RUSTFLAGS="-C link-arg=/opt/homebrew/opt/libyaml/lib/libyaml.a" cargo install pyoxidizer --root /opt/cargo/ --force
# zsh shell
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
omz update
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
cp .zshrc ~/.zshrc
source ~/.zshrc
# Show ~/Library folder
setfile -a v ~/Library
chflags nohidden ~/Library
# Customise Dock
dockutil --no-restart --remove all
dockutil --no-restart --add "/System/Applications/System Preferences.app"
dockutil --no-restart --add "/System/Applications/Notes.app"
dockutil --no-restart --add "/Applications/Slack.app"
dockutil --no-restart --add "/Applications/Google Chrome.app"
dockutil --no-restart --add "/Applications/Visual Studio Code.app"
dockutil --no-restart --add "/Applications/iTerm.app"
dockutil --no-restart --add "/Applications/1Password.app"
dockutil --no-restart --add "/Applications/Spotify.app"
dockutil --no-restart --add "/Applications/Signal.app"
dockutil --no-restart --add "/Applications/DevUtils.app"
dockutil --no-restart --add "/Applications/Obsidian.app"
killall Dock
# Defaults
./defaults.sh
# Add Go2Shell to Finder
./defaults/finder.sh
# Other defaults
./defaults/other.sh
# Set default file handlers
duti handlers.duti
# Create locate database
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
# Set default DNS
networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
# Starting CopyClip
open -a "CopyClip"
read -p "ℹ️ Start CopyCut on startup and press any key..."
# Starting CleanShot
open -a "CleanShot X"
read -p "ℹ️ Activate CleanShot and press any key..."
# Starting Docker
open -a "Docker"
read -p "ℹ️ Configure and log in to Docker and press any key..."
echo -e "\033[1mFinal Steps\033[0m"
cat << EOF
macOS
- Log in to iCloud
- Set resolution to 'More Space' in System Preferences > Displays
- Change appearance to dark
Chrome
- Sign in
Visual Studio Code
- Turn on Settings Sync
Accounts
- Sign in to 1Password
- Sign in to Slack
- Sign in to Spotify
EOF