This script will provision a new machine running a fresh install of macOS Big Sur (11.15). It installs and configures software, dotfiles, and general preferences. The command line environment is based on Zsh running in iTerm2.
The bootstrap
script is very specific to the Mac platform.
▹ Looking for dotfiles only? Check out My Dotfiles for macOS
-
Make sure your software is up to date:
sudo softwareupdate -i -a --restart
-
Install Apple's command line tools:
xcode-select --install
-
Reboot, check for additional updates, then reinstall and reboot as needed.
To install with a one-liner, run this:
curl --remote-name https://raw.githubusercontent.com/JSaterdalen/mac-bootstrap/master/bootstrap && sh bootstrap 2>&1 | tee ~/bootstrap.log
Want to read through the script first?
curl --remote-name https://raw.githubusercontent.com/JSaterdalen/mac-bootstrap/master/bootstrap
less bootstrap
sh bootstrap 2>&1 | tee ~/bootstrap.log
WARNING: This script will ask for your sudo password multiple times. You'll need to babysit it for a while. 😉
When you invoke bootstrap
, here's what it does:
- Step 1: Run an adaptation of thoughtbot's Laptop script, tweaked from joshukraine. This is a provisioning script which installs lots of goodies like Homebrew, asdf, etc. My version is now stored locally in this repo under
install/laptop
. Step 1 also installs a variety of packages via Homebrew Bundle. - Step 2: Install Oh My Zsh if Zsh selected as default shell.
- Step 3: Set a variety of macOS defaults. (adapted from https://mths.be/macos)
- Step 4: Clone My Dotfiles for macOS and symlink them to
$HOME
as needed.
After running bootstrap
there are still a few things that need to be done.
- Restart your machine in order for some changes to take effect.
- Complete post-install tasks from dotfiles README.
- Set up desired macOS keyboard shortcuts (see list below)
These are my (current) primary macOS keyboard shortcuts:
- Alfred: ⌘Space
- Clipboard (Alfred) ⌥⌘C
- Spotlight search: ⌘⇧Space
- Switch input source: ⌃⇧Space
- Fantastical: ⌥⌘Space
- iTerm2 hotkey window: ⌥Space
- Remap Caps Lock to CTRL (anyone know a way to automate this?)
No one else's development setup will ever be a perfect match for you. That said, if your needs are close enough to mine, you might benefit from using the same shell scripts and overall structure, and just swapping out the particulars with your own. Here's my recommended approach to doing that:
-
Fork this repo and clone your new fork to your local machine.
-
Review the
VARIABLE DECLARATIONS
section and customize as desired. -
Review the 7 steps in
bootstrap
and make your own customizations. Here's an overview of what's going on:
- Step 1 (required): Take a look at Laptop and see what you might want to tweak. One of the biggest things to review is the
brew bundle
list of packages and casks that will be installed. Customize as needed. Laptop also sets up some basics that are required by the bootstrap script later on. - Step 2 (recommended): Use Oh My Zsh?
- Step 3 (required): Review general macOS settings in
install/macos-defaults
and adjust as needed. This script also sets things likeHostName
which are needed later for the dotfiles installation. - Step 4 (recommended): Install scripts to
~/bin
? - Step 5 (recommended): Set up Tmuxinator profile?
- Step 6 (optional): Install Ukrainian language utilities? Maybe you're interested in some [other language extensions][lang-extensions]?
- Step 7 (required): The dotfiles. Update the
$DOTFILES_*
variables (seebootstrap
under "VARIABLE DECLARATIONS") to reference your dotfiles. As a starting point, you can fork mine and then point to your fork.
-
Create
~/dotfiles/local/config.fish.local
or~/.zshrc.local
,~/.gitconfig.local
, and~/.vimrc.local
and add in your personal information. These files are sourced in~/.config/fish/config.fish
or~/.zshrc
,~/.gitconfig
, and~/.vimrc
respectively. -
Update the README with your own info, instructions/reminders so you don't forget what you did, and especially the correct install URL:
curl --remote-name https://raw.githubusercontent.com/YOUR-GITHUB-USERNAME/mac-bootstrap/master/bootstrap && sh bootstrap 2>&1 | tee ~/boostrap.log
- Run the script on your machine and wait for the first error. 😇 Then fix, commit, push, and repeat.
- Pro Vim (https://github.com/Integralist/ProVim)
- Trevor Brown (https://github.com/Stratus3D/dotfiles)
- Chris Toomey (https://github.com/christoomey/dotfiles)
- thoughtbot (https://github.com/thoughtbot/dotfiles)
- Lars Kappert (https://github.com/webpro/dotfiles)
- Ryan Bates (https://github.com/ryanb/dotfiles)
- Ben Orenstein (https://github.com/r00k/dotfiles)
- Joshua Clayton (https://github.com/joshuaclayton/dotfiles)
- Drew Neil (https://github.com/nelstrom/dotfiles)
- Kevin Suttle (https://github.com/kevinSuttle/OSXDefaults)
- Carlos Becker (https://github.com/caarlos0/dotfiles)
- Zach Holman (https://github.com/holman/dotfiles/)
- Mathias Bynens (https://github.com/mathiasbynens/dotfiles/)
- Paul Irish (https://github.com/paulirish/dotfiles)
- http://dotfiles.github.io/
- https://medium.com/@webprolific/getting-started-with-dotfiles-43c3602fd789
- http://code.tutsplus.com/tutorials/setting-up-a-mac-dev-machine-from-zero-to-hero-with-dotfiles--net-35449
- https://github.com/webpro/awesome-dotfiles
- http://blog.smalleycreative.com/tutorials/using-git-and-github-to-manage-your-dotfiles/
- http://carlosbecker.com/posts/first-steps-with-mac-os-x-as-a-developer/
- https://mattstauffer.co/blog/setting-up-a-new-os-x-development-machine-part-1-core-files-and-custom-shell
Copyright © 2021 Joshua Steele. MIT License