Skip to content

Instantly share code, notes, and snippets.

@jfryman
Last active October 20, 2015 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfryman/06647d4693d76703ff08 to your computer and use it in GitHub Desktop.
Save jfryman/06647d4693d76703ff08 to your computer and use it in GitHub Desktop.
Easy OSX Management with Boxen and Homebrew

Boxen as an App Manager

Dowside to boxen is the community of supporters. It's a popular project, but nowhere near as popular as Homebrew (Casks) are. After two years of using only Boxen modules, I gave up. Updates were too slow, lots of overhead to get modules approved, and I still ended up writing a good number of modules myself. Not really a value-add, if I'm just adding an abstraction layer that I still need to manage. Ideally, I'd like to leverage the skills of the larger community and rely on herd-mentality to keep my system updated.

To that end, I wanted a quick and easy way to add/remove applications to my system to be managed without worrying about the future of the computer. Here is what my system looks like:

  • All data stored in GitHub, Dropbox or BTSync. Boxen creates Symlinks from popular folders to ~/ as needed.
  • All apps are installed via Boxen. Very few exceptions. Boxen manages App Store, Homebrew Installs, and Symlinks only.

Flow

$ boxen-edit hiera
$ boxen-save "commit message"
$ boxen

The scripts exist to remove friction and ensure good habits. This means real commit messages and ensuring everything is saved in SCM and stored offsite as soon as a save occurs.

That's it! Anytime I want a new application, I'll do a quick search for it via Homebrew, edit the files as needed, and move on with life. If I have a failure of a laptop, I simply download Boxen on a new machine, and depending on Internet speed I have my environment back in about 2 hours, and all my data back in under 24. I can get work done after the 2 hour mark, and I'm moving again after the data restore.

Who cares about the laptop? It's not a ❄️ anymore. It's just my computing device. I'll take a new one, anytime.

# This file contains all of the settings for my computer
---
# Cask Search: http://caskroom.io/search
# Apple ID Search: https://github.com/xdissent/puppet-appstore
appstore::appleid: "XXX"
appstore::password: "XXX"
appstore::store: "us"
appstore::apps:
"iStat Mini":
source: 'istat-mini/id927292435'
Cyberduck:
source: 'cyberduck/id409222199'
GrimFandango:
source: "grim-fandango-remastered/id1022841309"
Dash:
source: "dash-3-api-docs-snippets./id449589707"
Divvy:
source: "divvy-window-manager/id413857545"
OmniGraffle:
source: "omnigraffle-6/id711830901"
Watts:
source: "watts/id422559334"
"Textual 5":
source: "textual-5/id896450579"
OmniFocus:
source: "omnifocus-2/id867299399"
Slack:
source: "slack/id803453959"
DaisyDisk:
source: "daisydisk/id411643860"
Skitch:
source: "skitch-snap.-mark-up.-share./id425955336"
"YubiKey Personalization Tool":
source: "yubikey-personalization-tool/id638161122"
1Password:
source: "1password-password-manager/id443987910"
Numbers:
source: "numbers/id409203825"
Pocket:
source: "pocket/id568494494"
Keynote:
source: "keynote/id409183694"
Pages:
source: "pages/id409201541"
"Day One":
source: "day-one/id422304217"
Evernote:
source: "evernote/id406056744"
Caffeine:
source: "caffeine/id411246225"
Tweetbot:
source: "tweetbot-for-twitter/id557168941"
"The Unarchiver":
source: "the-unarchiver/id425424353"
"Microsoft Remote Desktop":
source: "microsoft-remote-desktop/id715768417"
# Boxen Modules
apps:
- tmux
- wget
# Homebrew Apps
homebrew::packages:
- "reattach-to-user-namespace"
- "elixir"
- "axel"
- "gnupg2"
- "nmap"
- "pyenv"
- "pyenv-virtualenv"
- "aspell"
- "cmake"
- "dfu-util"
# Symlinks
dotfiles::dirs:
- .gnupg
- bin
dotfiles::files:
- .aliases
- .env
- .gitconfig
- .tmux.conf
- .vimrc
- .zlogin
- .zlogout
- .zpreztorc
- .zprofile
- .zshenv
- .zshrc
- .tmuxinator
- .bundle
- .spacemacs
# Homebrew Casks
homebrew::casks:
- "iterm2-nightly"
- "java"
- "alfred"
- "skype"
- "vagrant"
- "steam"
- "spotify"
- "vmware-fusion"
- "dropbox"
- "packer"
- "appcleaner"
- "flux-beta"
- "arduino"
- "screenhero"
- "vyprvpn"
- "teensy"
- "bartender"
- "heroku-toolbelt"
- "emacs-mac"
- "microsoft-office365"
- "libreoffice"
- "xquartz-beta"
- "unifi-controller"
- "tunnelblick-beta"
- "transmission"
- "sonos"
- "little-snitch"
- "wireshark"
- "apache-directory-studio"
- "tuneup"
- "calibre"
- "cisco-spark"
- "google-drive"
- "firefox"
- "google-chrome"
- "istat-menus"
- "bittorrent-sync"
- "torbrowser"
- "flash"
- "macvim"
- "unetbootin"
- "rescuetime"
- "omnifocus"
- "macid"
- "licecap"
- "namebench"
- "tigervnc-viewer"
- "camtasia"
- "smart-scroll"
- "terraform"
class people::jfryman {
#include ::people::jfryman::env_settings
$_apps = hiera('apps', undef)
$_homebrew_packages = hiera('homebrew::packages', undef)
$_homebrew_casks = hiera('homebrew::casks', undef)
$_homebrew_taps = hiera('homebrew::taps', undef)
$_appstore_apps = hiera('appstore::apps', undef)
$_homedir = "/Users/${::luser}"
if $_apps {
validate_array($_apps)
include $_apps
}
if $_appstore_apps {
validate_hash($_appstore_apps)
create_resources('appstore::app', $_appstore_apps)
}
if $_homebrew_packages {
package { $_homebrew_packages:
ensure => present,
provider => 'homebrew',
}
}
if $_homebrew_taps {
homebrew::tap { $_homebrew_taps: }
}
if $_homebrew_casks {
include ::brewcask
package { $_homebrew_casks:
ensure => present,
provider => 'brewcask',
}
sudoers { 'cask-installer':
users => $::boxen_user,
hosts => 'ALL',
commands => [
'(ALL) NOPASSWD:SETENV: /usr/sbin/installer',
],
type => 'user_spec',
}
}
## Dotfiles
include ::dotfiles
::dotfiles::dir { '.ssh':
mode => '0700',
}
repository { "${_homedir}/.zprezto":
source => 'sorin-ionescu/prezto',
extra => [
'--recursive',
],
}
file { "${_homedir}/repo":
ensure => link,
target => '/Volumes/Repositories',
}
## Spacemacs
repository { "${_homedir}/.emacs.d":
source => 'syl20bnr/spacemacs',
extra => [
'--recursive',
],
}
## Vagrant
vagrant::plugin { 'vagrant-vmware-fusion':
license => 'puppet:///modules/people/jfryman/licenses/fusion.lic',
}
Package['vagrant'] -> Vagrant::Plugin<||>
sudoers { 'vagrant-nfs':
users => $::boxen_user,
hosts => 'ALL',
commands => [
'(ALL) NOPASSWD: /usr/bin/tee -a /etc/exports',
'(ALL) NOPASSWD: /sbin/nfsd restart',
'(ALL) NOPASSWD: /usr/bin/sed -E -e /*/ d -ibak /etc/exports',
],
type => 'user_spec',
}
}
#!/usr/bin/env bash
REPO=/opt/boxen/repo
if [ $# -eq 0 ]; then
echo "dude, come on. what do you want to edit?"
echo "manifest? hiera?. gimmie something, mang"
exit 1
fi
TYPE=$1
case $TYPE in
manifest)
FILE="${REPO}/modules/people/manifests/jfryman.pp"
;;
hiera)
FILE="${REPO}/hiera/users/jfryman.yaml"
;;
*)
echo "mang, what even is that? try again"
exit 1
;;
esac
vi $FILE
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "dude, come on. commit message"
exit 1
fi
COMMIT_MESSAGE=$1
cd /opt/boxen/repo
git commit -am "cli save: ${COMMIT_MESSAGE}"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment