osx-bootstrap

Script to set up a Mac OS X

It can be run multiple times on the same machine safely. It installs, upgrades, or skips packages based on what is already installed on the machine.

Requirements

Shell
Operating System
  • OS X >= 10.10

Commandline Tools * Script will invoke xcode-select --install, when necessary, but requires user interactivity

What it sets up

Mac OS X tools
  • Homebrew for managing operating system libraries.

Unix tools
  • Git for version control

  • OpenSSL for Transport Layer Security (TLS) Ruby

  • Installs and uses rbenv to install latest Ruby

Install

Clone, review, then execute the script:

sh bootstrap

To install with samples provided in the repo, run

sh bootstrap sample

This will copy the files from the sample directory to ~/

Customize

Customize the script in * ~/.bootstrap.local * ~/.Brewfile

These files are left in place, post install, and can be edited, locally, for further customization.

Local Brewfile

A Brewfile is like a Gemfile for non-ruby dependencies. Anything you would install via homebrew you can drop into your ~/.Brewfile and it will be installed during the bootstrap script.

An example Brewfile looks like this:

# 3rd party Taps
tap 'homebrew/bundle'
tap 'caskroom/cask'

# Homebrew Packages
brew 'ack'
brew 'keybase'
brew 'tmux'

# Cask macOS Apps
cask 'java'

# Mac store Apps
mas '1Password', id: 443987910
mas 'Xcode', id: 497799835

.bootstrap.local

Your ~/.bootstrap.local is run at the end of the bootstrap script. Put your customizations there. An example local script could look like this:

#!/bin/bash
...
echo "Add your changes here"
...

Write your customizations such that they can be run safely more than once. See the bootstrap script for examples.

The ./sample/.bootstrap.local script will install nodenv and node, cocoapods, configure ~/.zshrc with path and tools init, install VS Code extensions, etc.

Script functions such as append_to_shellrc, fancy_echo and install_or_update_gem can be used in your ~/.bootstrap.local.