Personal macOS bootstrap: Homebrew packages, symlinked dotfiles, and optional system defaults. Safe to re-run; paths are resolved from the script’s location, so the repo can live anywhere on disk.
GitHub: RVP97/setup-computer — URLs and defaults in install.sh use this owner/repo unless you override SETUP_COMPUTER_GITHUB.
Target hardware: Apple Silicon Macs (M1 / M2 / M3 / M4 / M5 and later). Homebrew and dotfiles/.zshrc assume the standard prefix /opt/homebrew. Intel Macs are not supported here.
- macOS on Apple Silicon
- Network access for Homebrew and
brew bundle
This repo is public — no GitHub token needed for the paths below (unless you use a private fork).
Recommended: git clone + bootstrap.sh
This is the path most dotfiles-style repos use: you get a real .git directory, can git pull to update scripts, and you run bootstrap.sh from a checkout you can read first.
git clone https://github.com/RVP97/setup-computer.git ~/setup-computer
cd ~/setup-computer
chmod +x bootstrap.sh macos.sh
./bootstrap.shIf git clone on macOS prompts for Xcode/Developer Tools, install Command Line Tools first, then retry:
xcode-select --installSSH (if your GitHub account uses it): git clone git@github.com:RVP97/setup-computer.git ~/setup-computer
Quick alternative: one-liner (install.sh)
Same end state with fewer commands; handy on a brand-new Mac:
curl -fsSL https://raw.githubusercontent.com/RVP97/setup-computer/main/install.sh | bashCaveat: if git is missing and the script falls back to a tarball, that tree has no .git — run git clone into ~/setup-computer later if you want normal pulls. Treat curl | bash like any remote script (you trust main on this repo).
Use a PAT (never commit it):
export GITHUB_TOKEN=ghp_your_token_here
curl -fsSL \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.raw" \
"https://api.github.com/repos/RVP97/setup-computer/contents/install.sh?ref=main" | bashOr copy install.sh to the machine and run GITHUB_TOKEN=… bash install.sh.
| Variable | Default | Purpose |
|---|---|---|
GITHUB_TOKEN |
(unset) | Only for private repos or authenticated API fetch |
SETUP_COMPUTER_DIR |
$HOME/setup-computer |
Where the repo is placed |
SETUP_COMPUTER_BRANCH |
main |
Branch to clone / archive |
SETUP_COMPUTER_GITHUB |
RVP97/setup-computer |
owner/repo for GitHub URLs |
SETUP_COMPUTER_CLONE_URL |
(derived) | Override clone URL (e.g. SSH or fork) |
Security: Treat curl … | bash like running any remote script; this one is yours on main. PATs can appear briefly in process listings—revoke one-off tokens after use.
On an interactive terminal, bootstrap.sh finishes by running exec zsh -l, so a login zsh starts with your new PATH and ~/.zshrc without opening another window. Type exit if you want the shell you launched bootstrap from.
Set SETUP_COMPUTER_SKIP_ZSH_REEXEC=1 (e.g. in CI) to skip that and only print the reminder.
If Homebrew was just installed and the script exits asking for a new terminal before Homebrew is on PATH, open a new window and run ./bootstrap.sh again — that case happens before the final exec zsh -l.
- Installs Homebrew if it is missing, then loads it into the current shell.
- Adds a single
brew shellenvline to~/.zprofileif one is not already there (re-runs do not duplicate it). - Runs
brew updateandbrew bundleusing this repo’sBrewfile. - Installs Oh My Zsh with the upstream installer if
~/.oh-my-zshis missing (Homebrew does not provide a supported formula). UsesKEEP_ZSHRC=yesso your symlinked~/.zshrcis preserved. Also clones Powerlevel10k, zsh-autosuggestions, and zsh-syntax-highlighting into~/.oh-my-zsh/custom/when needed so the bundled.zshrcworks on a new machine. - Symlinks
dotfiles/.zshrc→~/.zshrc,dotfiles/.gitconfig→~/.gitconfig, anddotfiles/.ssh/config→~/.ssh/config, creates~/.sshif needed, and sets600on the SSH config. - If
dev-reposhas entries, prompts you to unlock 1Password (for SSH), then clones or updates repos under~/dev(see file for path layout). - Runs
macos.shwhen it exists and is executable (chmod +x macos.sh). - In an interactive terminal, runs
exec zsh -lso a login zsh loads with the updatedPATHand~/.zshrc(skippable withSETUP_COMPUTER_SKIP_ZSH_REEXEC=1).
Applies defaults for Dock, keyboard repeat, trackpad, Finder, screenshots, and a few global UI tweaks, then restarts Dock, Finder, and SystemUIServer where needed. Run it alone anytime:
./macos.shSome changes may require logging out and back in.
- Packages and apps: edit
Brewfile, then runbrew bundle(or re-run./bootstrap.sh). - Shell, Git, and SSH client config: edit files under
dotfiles/; symlinks pick up changes immediately. For Git identity, seedotfiles/.gitconfig(or override locally withgit config --globalif you do not want it in the repo). - SSH keys: this repo only manages
~/.ssh/config. Generate or copy keys separately; do not commit private keys. - Dev projects: edit
dev-repos—owner/repoper line (SSH). If the file has entries,bootstrap.shpauses before cloning so you can unlock 1Password (yourdotfiles/.ssh/configuses the 1Password agent). SetSETUP_COMPUTER_SKIP_DEV_PAUSE=1to skip the pause. Optional path first (webdev,webdev/paginas, …) under~/dev. Env:SETUP_COMPUTER_DEV_ROOT,SETUP_COMPUTER_GITHUB_HOST(Enterprise).
If you only want to clone/update projects from dev-repos (without running full bootstrap):
./clone-dev-repos.shYou can also pass a different list file:
./clone-dev-repos.sh /path/to/dev-reposAfter git clone succeeds for your repos, copy macOS Quick Actions from mac-automator:
mkdir -p ~/Library/Services && cp -R "/Users/rodrigo/dev/automation/mac-automator/"*.workflow ~/Library/Services/| Path | Role |
|---|---|
install.sh |
Remote one-liner: fetch repo + run bootstrap.sh |
bootstrap.sh |
One-shot machine setup |
Brewfile |
brew bundle formula and cask list |
macos.sh |
macOS defaults |
dev-repos |
Optional: one owner/repo per line → cloned into ~/dev |
clone-dev-repos.sh |
Standalone clone/update for entries in dev-repos |
dotfiles/ |
Source files symlinked into $HOME |