Last active
April 20, 2026 03:44
-
-
Save gregberns/852305ac37f7cfed34b6637de4042f23 to your computer and use it in GitHub Desktop.
adze config: macOS dev box + bootstrap script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Bootstrap a new macOS dev machine with adze | |
| # | |
| # IMPORTANT: Download first, then run — do NOT pipe to bash. | |
| # Homebrew and sudo need interactive stdin. | |
| # | |
| # curl -fsSL https://gist.githubusercontent.com/gregberns/852305ac37f7cfed34b6637de4042f23/raw/gist-bootstrap.sh -o ~/bootstrap.sh | |
| # chmod +x ~/bootstrap.sh | |
| # ~/bootstrap.sh | |
| set -euo pipefail | |
| # Ensure we're not piped (stdin must be a terminal for sudo/brew) | |
| if [ ! -t 0 ]; then | |
| echo "ERROR: Don't pipe this script. Download and run it instead:" | |
| echo "" | |
| echo " curl -fsSL https://gist.githubusercontent.com/gregberns/852305ac37f7cfed34b6637de4042f23/raw/gist-bootstrap.sh -o ~/bootstrap.sh" | |
| echo " chmod +x ~/bootstrap.sh" | |
| echo " ~/bootstrap.sh" | |
| exit 1 | |
| fi | |
| INSTALL_DIR="$HOME/.local/bin" | |
| mkdir -p "$INSTALL_DIR" | |
| echo "==> Installing Xcode Command Line Tools (if needed)..." | |
| if ! xcode-select -p &>/dev/null; then | |
| xcode-select --install | |
| echo " Waiting for Xcode CLT install to complete..." | |
| echo " (Click 'Install' in the dialog that appeared)" | |
| until xcode-select -p &>/dev/null; do sleep 5; done | |
| echo " Done." | |
| fi | |
| echo "==> Installing Homebrew (if needed)..." | |
| if ! command -v brew &>/dev/null; then | |
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| fi | |
| # Add brew to PATH for this session (Apple Silicon) | |
| if [ -f /opt/homebrew/bin/brew ]; then | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| fi | |
| echo "==> Installing Go (needed to build adze)..." | |
| if ! command -v go &>/dev/null; then | |
| brew install go | |
| # Refresh PATH so we can find go | |
| eval "$(/opt/homebrew/bin/brew shellenv)" | |
| fi | |
| echo "==> Installing adze..." | |
| if ! command -v adze &>/dev/null; then | |
| ADZE_TMP=$(mktemp -d) | |
| git clone https://github.com/gregberns/adze.git "$ADZE_TMP/adze" | |
| (cd "$ADZE_TMP/adze" && go build -o "$INSTALL_DIR/adze" ./cmd/adze/) | |
| rm -rf "$ADZE_TMP" | |
| echo " Installed to $INSTALL_DIR/adze" | |
| fi | |
| # Ensure ~/.local/bin is in PATH for this session | |
| export PATH="$INSTALL_DIR:$PATH" | |
| echo "==> Downloading config..." | |
| CONFIG_DIR="$HOME/.config/adze" | |
| mkdir -p "$CONFIG_DIR" | |
| curl -fsSL "https://gist.githubusercontent.com/gregberns/852305ac37f7cfed34b6637de4042f23/raw/gist-macos-dev.yaml" -o "$CONFIG_DIR/config.yaml" | |
| echo "==> Validating config..." | |
| adze validate --config "$CONFIG_DIR/config.yaml" | |
| # Persist PATH additions to ~/.zprofile so new shells find brew + adze | |
| ZPROFILE="$HOME/.zprofile" | |
| if ! grep -q '/opt/homebrew/bin/brew shellenv' "$ZPROFILE" 2>/dev/null; then | |
| echo >> "$ZPROFILE" | |
| echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> "$ZPROFILE" | |
| fi | |
| if ! grep -q '\.local/bin' "$ZPROFILE" 2>/dev/null; then | |
| echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$ZPROFILE" | |
| fi | |
| echo "" | |
| echo "Done! Run:" | |
| echo "" | |
| echo " # Preview what will be done:" | |
| echo " adze plan --config ~/.config/adze/config.yaml" | |
| echo "" | |
| echo " # Apply the config:" | |
| echo " adze apply --config ~/.config/adze/config.yaml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Greg's Mac Mini" | |
| platform: darwin | |
| machine: | |
| hostname: gb-mac-mini | |
| identity: | |
| git_name: "Greg Berns" | |
| git_email: "gregberns@gmail.com" | |
| github_user: gregberns | |
| secrets: | |
| - name: GITHUB_TOKEN | |
| description: "GitHub CLI auth (set automatically by 'gh auth login')" | |
| required: false | |
| sensitive: true | |
| validate: "gh auth status" | |
| packages: | |
| brew: | |
| - bash | |
| - git | |
| - gh | |
| - go | |
| - tmux | |
| - uv | |
| - dolt | |
| - jq | |
| - ripgrep | |
| - fzf | |
| - bat | |
| - fd | |
| - eza | |
| - neovim | |
| - curl | |
| - wget | |
| - gnupg | |
| - lima | |
| - yt-dlp | |
| - tree | |
| - trash | |
| - node | |
| - dockutil | |
| - coreutils | |
| - fnm | |
| - tldr | |
| cask: | |
| - brave-browser | |
| - iterm2 | |
| - wezterm | |
| - libreoffice | |
| - slack | |
| - vlc | |
| - docker | |
| - firefox | |
| - visual-studio-code | |
| - flux | |
| - diffmerge | |
| - alfred | |
| - spotify | |
| defaults: | |
| # -- Global -- | |
| NSGlobalDomain: | |
| # Show all file extensions | |
| AppleShowAllExtensions: true | |
| # Save to disk, not iCloud, by default | |
| NSDocumentSaveNewDocumentsToCloud: false | |
| # Disable smart quotes (annoying when typing code) | |
| NSAutomaticQuoteSubstitutionEnabled: false | |
| # Disable smart dashes | |
| NSAutomaticDashSubstitutionEnabled: false | |
| # Full keyboard access for all controls (Tab in dialogs) | |
| AppleKeyboardUIMode: 3 | |
| # Disable press-and-hold for keys in favor of key repeat | |
| ApplePressAndHoldEnabled: false | |
| # Subpixel font rendering on non-Apple LCDs | |
| AppleFontSmoothing: 2 | |
| # Disable system-wide resume | |
| NSQuitAlwaysKeepsWindows: false | |
| # Disable automatic termination of inactive apps | |
| NSDisableAutomaticTermination: true | |
| # Expand save panel by default | |
| NSNavPanelExpandedStateForSaveMode: true | |
| # Expand print panel by default | |
| PMPrintingExpandedStateForPrint: true | |
| PMPrintingExpandedStateForPrint2: true | |
| # Web Inspector in all web views | |
| WebKitDeveloperExtras: true | |
| # -- Dock -- | |
| com.apple.dock: | |
| autohide: true | |
| autohide-delay: 0 | |
| autohide-time-modifier: 0 | |
| tilesize: 36 | |
| # Don't rearrange spaces by most recent use | |
| mru-spaces: false | |
| # Speed up Mission Control animations | |
| expose-animation-duration: 0.1 | |
| # Group windows by application in Mission Control | |
| expose-group-by-app: true | |
| # Don't show recent apps | |
| show-recents: false | |
| # -- Finder -- | |
| com.apple.finder: | |
| # Column view by default | |
| FXPreferredViewStyle: Clmv | |
| # Show hard drives, servers, removable media on desktop | |
| ShowExternalHardDrivesOnDesktop: true | |
| # Disable warning when changing file extension | |
| FXEnableExtensionChangeWarning: false | |
| # Allow text selection in Quick Look | |
| QLEnableTextSelection: true | |
| # -- Screenshots -- | |
| com.apple.screencapture: | |
| location: "~/Screenshots" | |
| type: png | |
| # -- Avoid .DS_Store on network volumes -- | |
| com.apple.desktopservices: | |
| DSDontWriteNetworkStores: true | |
| # -- Printer -- | |
| com.apple.print.PrintingPrefs: | |
| "Quit When Finished": true | |
| # -- Mail -- | |
| com.apple.mail: | |
| # Copy email as 'foo@example.com' not 'Name <foo@example.com>' | |
| AddressesIncludeNameOnPasteboard: false | |
| # -- Terminal -- | |
| com.apple.terminal: | |
| StringEncodings: 4 | |
| # -- Time Machine -- | |
| com.apple.TimeMachine: | |
| DoNotOfferNewDisksForBackup: true | |
| # -- Chrome -- | |
| com.google.Chrome: | |
| # Disable annoying backswipe | |
| AppleEnableSwipeNavigateWithScrolls: false | |
| # -- Safari -- | |
| com.apple.Safari: | |
| ShowFavoritesBar: false | |
| ShowSidebarInTopSites: false | |
| DebugSnapshotsUpdatePolicy: 2 | |
| IncludeInternalDebugMenu: true | |
| FindOnPageMatchesWordStartsOnly: false | |
| IncludeDevelopMenu: true | |
| WebKitDeveloperExtrasEnabledPreferenceKey: true | |
| "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled": true | |
| # -- Disable Gatekeeper -- | |
| com.apple.LaunchServices: | |
| LSQuarantine: false | |
| dock: | |
| apps: | |
| - /Applications/Brave Browser.app | |
| - /Applications/WezTerm.app | |
| - /Applications/iTerm.app | |
| - /Applications/Slack.app | |
| - /Applications/Visual Studio Code.app | |
| - /Applications/Firefox.app | |
| - /Applications/Spotify.app | |
| shell: | |
| default: zsh | |
| oh_my_zsh: true | |
| theme: robbyrussell | |
| plugins: | |
| - git | |
| - zsh-syntax-highlighting | |
| - zsh-autosuggestions | |
| directories: | |
| - ~/github | |
| - ~/gitlab | |
| - ~/projects | |
| - ~/Screenshots | |
| - ~/.config | |
| - ~/.local/bin | |
| custom_steps: | |
| gh-auth: | |
| description: "Authenticate GitHub CLI (opens browser)" | |
| provides: [gh-authenticated] | |
| requires: [brew-packages] | |
| platform: [darwin] | |
| check: "gh auth status 2>/dev/null" | |
| apply: | |
| darwin: "gh auth login --web --git-protocol ssh" | |
| env: [] | |
| tags: [auth] | |
| iterm-settings: | |
| description: "Restore iTerm2 settings from dotfiles" | |
| provides: [iterm-configured] | |
| requires: [] | |
| platform: [darwin] | |
| check: "defaults read com.googlecode.iterm2 PrefsCustomFolder 2>/dev/null | grep -q dotfiles" | |
| apply: | |
| darwin: | | |
| if [ -d "$HOME/.dotfiles/iterm2" ]; then | |
| defaults write com.googlecode.iterm2 PrefsCustomFolder -string "$HOME/.dotfiles/iterm2" | |
| defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true | |
| echo "iTerm2 configured to load settings from ~/.dotfiles/iterm2" | |
| elif [ -d "$HOME/github/dotfiles/iterm2" ]; then | |
| defaults write com.googlecode.iterm2 PrefsCustomFolder -string "$HOME/github/dotfiles/iterm2" | |
| defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true | |
| echo "iTerm2 configured to load settings from ~/github/dotfiles/iterm2" | |
| else | |
| echo "No iTerm2 settings found. To export: iTerm2 > Settings > General > Settings > Save to Folder" | |
| fi | |
| env: [] | |
| tags: [terminal] | |
| dotfiles: | |
| description: "Clone dotfiles repo" | |
| provides: [dotfiles] | |
| requires: [git-config, gh-authenticated, ssh-keys] | |
| platform: [darwin] | |
| check: "[ -d $HOME/.dotfiles ] || [ -d $HOME/github/dotfiles ]" | |
| apply: | |
| darwin: "cd ~ && git clone git@github.com:gregberns/dotfiles.git .dotfiles" | |
| env: [] | |
| tags: [config] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment