In case you’re unacquainted, Boxen is an open source project that can setup your macOS machine(s): it automatically installs apps, developer tools and just about anything else you might need. Unlike third-party backup services, Boxen does this by reading manifest files you provide—thus affording you all the advantages of Infrastructure as Code:
- You have full control over what gets installed, and where. This is unlike backup services I’ve played with, which appear to just back up and restore everything on your hard drive.
- Configuration files (such as your
.vimrc) can be committed to source control. This allows you to experiment with different setups,
$ git checkoutif it goes all wrong, and ultimately
$ git committo new and exciting ways of working.
- If you can automate your setup on one macOS machine, then you can automate your setup on any macOS machine! “Setting up” becomes a case of checking out your Boxen repo, and running the
In fact, Boxen worked so well for me, it was part of my workflow for two years. I’d:
$ git commit && git pushnew setups on my Laptop A.
$ git pull && boxenon my own Laptop B.
- Marvel how fast Laptop B became a clone of Laptop A!
This workflow enabled me to transition between two unconnected machines seamlessly, in a way that encouraged me to play with new tools and configurations.
By developers, for developers!
In my opinion, Boxen’s greatest feature is that it provides a free “App-Store” for developer tools. You’ll find tools of which you are familiar, but you’ll also find tools of which you are not. And it’s here—in the latter category—where comes joy of using Boxen. A few of my favourite discoveries include:
- Tmux: how many terminal windows or tabs do you have open right now? If your answer is > 1, you could probably
change your lifebenefit by trying out Tmux. Tmux is like a tiling window manager, but for your terminal.
- Vim: okay, you’ve probably heard about Vim… However Boxen’s standard installation includes Vim plus several useful plugins, which encouraged me to drop hefty IDEs and switch to Vim.
- Hub: Is GitHub part of your workflow? This CLI tool from GitHub enables you to raise pull requests—and more—right from the comfort of your command line.
- Flux: Research suggests we should avoid gadgets before bed, to stop light interfering with our sleep patterns. As night approaches, Flux reduces the blue light emmitted from your screen to ease your eyes into sleeping.
But then came the woes.
- A brainchild of GitHub, it’s no surprise that Boxen has opinions about “how to do things”. Do you have any
*.deventries in your
hostsfile, mapped to local projects? Then brace yourself—as running
$ boxenfor the first time, will transfigure them into this: This sorcery is caused by GitHub’s custom build of NGINX: it clobbers
localhost:80by default, and all
*.devrequests get resolved to it via dnsmasq. Basically, should you not be employed by GitHub, expect to reverse engineer Boxen from time to time.
- Boxen “gatekeeps” the suite of open-source tools it provides; configuring them via Puppet modules instead of the tools’ norms. Your tools’ configuration therefore is useless outside of the realm of Boxen. Furthermore, your ability to use the open-source tools’ updates is limited by how fast the Puppet modules can implement them.
- Updating your Mac with Boxen can take a long time, as Boxen uses Puppet under the hood. Every time you run
$ boxen, Puppet has to compile your manifests into a catalog, before it actually applies said catalog to your Mac. In other words, Puppet hangs for (at least) a minute, deciding what your “perfect” Mac should look like. Then—happy with it’s vision—you’ll have to wait some more, whilst Puppet goes about “making it so”.
- Keeping up-to-date with Boxen’s upstream repository is hard: every now and again, you should pull the upstream project into your fork—to keep your Mac up-to-date. However, my experience of this hasn’t been so smooth; like with all the merge conflicts I’ve had to resolve, or when package managers (like
$ brew) started to fail randomly. Shared module updates have also been known to break things… all of which makes pulling updates, somewhat a chore.
Boxen is dead, long live Homebrew!
The biggest nail in the coffin for Boxen came from @MikeMcQuaid; then maintainer of the project. In a GitHub issue, Mike states GitHub is no longer interested in maintaining Boxen, and furthermore has moved on to maintain the Homebrew project. Homebrew can do most things Boxen can (check out Brewfiles for keeping your dependencies under source control!), with zero dependencies on Puppet.
Although I invested lots of time into maintaining my Boxen configuration, migrating to Homebrew was a natural, easy step thanks to @MikeMcQuaid’s Strap script. And in the rare cases Homebrew didn’t provide me what I wanted, it’s infinitely easier to extend then Boxen.