Skip to content

Instantly share code, notes, and snippets.

@ervinb
Forked from markusand/Brewfile
Last active July 10, 2025 08:18
Show Gist options
  • Save ervinb/bc9bc76005d32ea5dea514e2cb55f8ca to your computer and use it in GitHub Desktop.
Save ervinb/bc9bc76005d32ea5dea514e2cb55f8ca to your computer and use it in GitHub Desktop.
macOS auto setup

macOS clean setup

Customise macOS defaults and install software automatically.

Setup

Open macOS Terminal and run the following command

bash <(curl -s https://gist.githubusercontent.com/ervinb/bc9bc76005d32ea5dea514e2cb55f8ca/raw/install.sh)

Warning macOS user password and iCloud credentials will be prompted

🎉 That's it! Use this commonly wasted time enjoying a cup of coffee

Customisation

If the options in this configuration are not to your taste, fork this gist and customise as you prefer.

If you miss any important option, let's discuss it and I can add it to this gist.

Application Configurations

Use syncthing to sync ~/Library/Application\ Support.

  1. Start syncthing
  2. Visit the Web UI: http://127.0.0.1:8384/
  3. https://docs.syncthing.net/intro/getting-started.html
  4. Add ~/Library/Application\ Support
    • Configure directory as Send only: Edit > Advanced > Folder type
    • Opt-in what you want to sync by setting an ignore list (NOTE: do the same client side!):
      !/Alfred
      !/barrier
      !/BetterDisplay
      !/com.elgato.CameraHub
      !/com.helftone.monodraw
      !/com.lwouis.alt-tab-macos
      !/Element
      !/k9s
      !/lazygit
      !/monokle
      !/obs-studio
      !/obsidian
      **
      
    1. Sync ~/.ssh the same way

ASDF

  • backup installed tools to txt with, then loop over the lines to install: $ asdf list | tr '[:space:]' ' ' | sed 's/\([a-z]\+\)\(\s\+[0-9.*]\+\)\+/\1\2\n/g' | sed 's/*//g' > asdf-tools.txt $ asdf plugin list > asdf-plugins.txt

  • install

      ```
      $ curl -L https://gist.githubusercontent.com/ervinb/bc9bc76005d32ea5dea514e2cb55f8ca/raw/asdf-plugins.txt | while read plug; do asdf plugin add $plug; done
      
      $ curl -L https://gist.githubusercontent.com/ervinb/bc9bc76005d32ea5dea514e2cb55f8ca/raw/asdf-tools.txt | tr -s '[:blank:]' | while read tool; do echo "TOOL: $tool"; prog=$(echo $tool | cut -d' ' -f1 ); ver=$(echo $tool | cut -d' ' -f2); asdf install $prog $ver; done
      
      $ export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
      $ echo 'export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"' ~/.zshrc
      ```
    
golang
helm
k9s
kind
kubectl
kustomize
php
sloth
stern
terraform
terragrunt
nodejs
golang 1.22.0
helm 3.8.2
k9s 0.50.6
kind 0.21.0
kubectl 1.33.1
kustomize 5.2.1
php 8.3.21
sloth 0.11.0
stern 1.22.0
terraform 1.6.5
terragrunt 0.53.8
nodejs 24.3.0
# BASIC SOFTWARE -->
brew "mas"
mas "Slack", id: 803453959
mas "Notability", id: 360593530
mas "ScreenBrush", id: 1233965871
mas "WhatsApp", id: 310633997
mas "Color Picker", id: 1545870783
cask "rectangle"
cask "appcleaner"
cask "hiddenbar"
cask "spotify"
cask "imageoptim"
cask "syncthing-app"
cask "iterm2"
cask "alt-tab"
cask "meetingbar"
cask "obs"
cask "alfred"
cask "betterdisplay"
cask "elgato-camera-hub"
cask "monodraw"
cask "obsidian"
cask "thunderbird"
cask "vlc"
cask "karabiner-elements"
cask "session-manager-plugin"
# QUICKLOOK PLUGINS -->
cask 'qlmarkdown'
cask 'quicklook-json'
cask 'quicklook-csv'
cask 'qlstephen'
cask 'qlcolorcode'
# BROWSERS -->
cask "google-chrome"
cask "firefox"
# DEV TOOLS -->
tap "hashicorp/tap"
tap "argoproj/tap"
tap "aws/tap"
tap "derailed/k9s"
tap "hashicorp/tap"
tap "homeport/tap"
tap "iann0036/iamlive"
tap "argoproj/tap"
tap "aws/tap"
tap "derailed/k9s"
tap "hashicorp/tap"
tap "homeport/tap"
tap "iann0036/iamlive"
cask "visual-studio-code"
cask "cursor"
brew "act"
brew "rust"
brew "autoconf"
brew "nvim"
brew "tmux"
brew "lazygit"
brew "hashicorp/tap/vault"
brew "fontconfig"
brew "cairo"
brew "pycparser"
brew "cffi"
brew "gmp"
brew "zstd"
brew "gcc"
brew "harfbuzz"
brew "libtiff"
brew "little-cms2"
brew "webp"
brew "aider"
brew "jpeg-xl"
brew "aom"
brew "argocd"
brew "asciinema"
brew "asdf"
brew "aws-iam-authenticator"
brew "awscli"
brew "bash-completion"
brew "berkeley-db"
brew "bison"
brew "lima"
brew "colima", restart_service: :changed
brew "coreutils"
brew "dive"
brew "docker"
brew "docker-compose"
brew "docker-credential-helper"
brew "docutils"
brew "expect"
brew "fzf"
brew "gator"
brew "libavif"
brew "gd"
brew "gdk-pixbuf"
brew "gh"
brew "pango"
brew "gnu-sed"
brew "gomplate"
brew "goose"
brew "netpbm"
brew "gts"
brew "librsvg"
brew "graphviz"
brew "grep"
brew "helmfile"
brew "htop"
brew "imagemagick"
brew "jd"
brew "jq"
brew "jsonnet"
brew "k6"
brew "act"
brew "fontconfig"
brew "cairo"
brew "pycparser"
brew "cffi"
brew "gmp"
brew "zstd"
brew "gcc"
brew "harfbuzz"
brew "libtiff"
brew "little-cms2"
brew "webp"
brew "aider"
brew "jpeg-xl"
brew "aom"
brew "argocd"
brew "asciinema"
brew "asdf"
brew "aws-iam-authenticator"
brew "awscli"
brew "bash-completion"
brew "berkeley-db"
brew "bison"
brew "lima"
brew "colima", restart_service: :changed
brew "coreutils"
brew "dive"
brew "docker"
brew "docker-compose"
brew "docker-credential-helper"
brew "docutils"
brew "expect"
brew "fzf"
brew "gator"
brew "libavif"
brew "gd"
brew "gdk-pixbuf"
brew "gh"
brew "pango"
brew "gnu-sed"
brew "gomplate"
brew "goose"
brew "netpbm"
brew "gts"
brew "librsvg"
brew "graphviz"
brew "grep"
brew "helmfile"
brew "htop"
brew "imagemagick"
brew "jd"
brew "jq"
brew "jsonnet"
brew "k6"
#!/usr/bin/env bash
####
#
# https://macos-defaults.com
#
####
# 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 &
# GENERAL :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# NOTE: use '$ defaults read NSGlobalDomain' to read current values
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable auto-correct. OH YEAH PLEASE!
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
# Set language and text formats
defaults write NSGlobalDomain AppleLanguages -array "en" "hu" "sr_Latn"
defaults write NSGlobalDomain AppleLocale -string "en_NL@currency=EUR"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
defaults write NSGlobalDomain AppleMetricUnits -bool true
# Set the timezone
sudo systemsetup -settimezone "Europe/Amsterdam" > /dev/null
# Disable hibernation
sudo pmset -a hibernatemode 0
# KEYBOARD :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Fn key does nothing ie. no emoji by default
defaults write com.apple.HIToolbox AppleFnUsageType -int "0"
# Disable press and hold for accents
defaults write -g ApplePressAndHoldEnabled -bool false
# FINDER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Disable window animations
defaults write com.apple.finder DisableAllAnimations -bool true
# Disable warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Automatically open a new Finder window when a volume is mounted
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Set home as default location for new Finder windows
defaults write com.apple.finder NewWindowTarget -string "PfHm"
# Show status & path bar
defaults write com.apple.finder ShowStatusBar -bool true
defaults write com.apple.finder ShowPathbar -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Set grid spacing for icons on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 64" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 64" ~/Library/Preferences/com.apple.finder.plist
# Set icons size on the desktop and in other icon views
/usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 48" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 48" ~/Library/Preferences/com.apple.finder.plist
/usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 48" ~/Library/Preferences/com.apple.finder.plist
# Use icon view in all Finder windows by default
# Four-letter codes for the other view modes: 'Nlsv', 'clmv', 'glyv'
defaults write com.apple.finder FXPreferredViewStyle -string "icnv"
# Show the ~/Library folder
chflags nohidden ~/Library
# Create user Sites directory
mkdir -p "$HOME/Sites"
# DOCK ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Set the icon size of Dock items
defaults write com.apple.dock tilesize -int 32
# Minimize windows into their application’s icon
defaults write com.apple.dock minimize-to-application -bool true
# Wipe all default app icons from the Dock
defaults write com.apple.dock persistent-apps -array
# Don’t show recent applications in Dock
defaults write com.apple.dock show-recents -bool false
# NETWORK :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Set default Cloudflare DNS (and Google as fallback)
networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 8.8.8.8
echo 'Set macOS defaults...'
bash <(curl -s https://gist.githubusercontent.com/ervinb/bc9bc76005d32ea5dea514e2cb55f8ca/raw/defaults.sh)
echo 'Install base macOS software'
if [ $(which brew) ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew analytics off
export HOMEBREW_NO_ANALYTICS=1
fi
cd ~
curl https://gist.githubusercontent.com/ervinb/bc9bc76005d32ea5dea514e2cb55f8ca/raw/Brewfile -o Brewfile
brew bundle
rm Brewfile
echo 'Finished. Some changes require a restart to take effect.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment