-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_onchange_darwin_install-packages.sh.tmpl
More file actions
64 lines (55 loc) · 2.23 KB
/
Copy pathrun_onchange_darwin_install-packages.sh.tmpl
File metadata and controls
64 lines (55 loc) · 2.23 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
#!/bin/bash
{{ if eq .chezmoi.os "darwin" -}}
if ! command -v brew &>/dev/null; then
printf "Starting Homebrew installation...\n"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
printf "Homebrew installation completed\n"
fi
if [[ "$(uname -m)" == "arm64" && ! -f "/Library/Apple/usr/share/rosetta/rosetta" ]]; then
printf "\nStarting Rosetta 2 installation...\n"
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
printf "\Rosetta 2 installation completed\n"
fi
printf "\nStarting Homebrew packages installation...\n"
brew bundle --file=/dev/stdin <<EOF
{{- range .packages.darwin.brews }}
brew {{ . | quote }}
{{- end }}
{{- range .packages.darwin.casks }}
cask {{ . | quote }}
{{- end }}
EOF
printf "\nHomebrew packages installation completed.\n"
if [ ! -d "${HOME}/.tmux/plugins/tpm" ]; then
printf "\nInstalling Tmux Plugin Manager (TPM)...\n"
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/scripts/install_plugins.sh
printf "TPM installation completed.\n"
fi
printf "\nStarting App Store packages installation...\n"
{{- range .packages.darwin.mas }}
mas install {{ . }}
{{- end }}
printf "\nApp Store packages installation completed.\n"
printf "\nRemoving quarantine attributes from some apps...\n"
xattr -dr com.apple.quarantine /Applications/Chromium.app || echo "Chromium not found"
xattr -dr com.apple.quarantine /Applications/LibreWolf.app || echo "LibreWolf not found"
xattr -dr com.apple.quarantine /Applications/TomatoBar.app || echo "TomatoBar not found"
printf "\nQuarantine attributes removed (if apps were found).\n"
if ! command -v cargo &>/dev/null; then
printf "\nStarting rustup installation...\n"
rustup-init -y --no-modify-path
printf "Rustup installation completed.\n"
fi
NODE_SHIM="$HOME/.local/share/mise/shims/node"
NPX_SHIM="$HOME/.local/share/mise/shims/npx"
for pair in "node:$NODE_SHIM" "npx:$NPX_SHIM"; do
name="${pair%%:*}"
target="${pair#*:}"
link="/usr/local/bin/$name"
if [ ! -L "$link" ] || [ "$(readlink "$link")" != "$target" ]; then
printf "\n(Re)creating symlink for %s -> %s...\n" "$name" "$target"
sudo ln -sfn "$target" "$link"
fi
done
printf "\nInstallation script completed.\n"
{{ end -}}