Simplifying my machine config
For a long time I managed my machine using a set of nix config files. I really enjoyed using nix - almost everything on my machine was defined in the config files, and I could deterministically re-apply that config to a new machine. No more trying to remember what was installed, and which settings I had used. All of this was defined and managed through a combination of nix, nix darwin and home manager. I especially enjoyed that I could run any application in an isolated environment, and when I exited, the application and any dependencies it installed were gone.
There were drawbacks though - the nix language is not something I use daily, so every time I needed to make a change that was outside the basics, I found myself fighting to make it work. At the time there was an issue with GUI apps installed by nix, and the way they ran, and often the nix packages were not updated quickly enough (or didn’t support nightly builds). All of these are totally reasonable - the language needs to be prescriptive enough to support the use case, I cannot begin to imagine the complexity of maintaining cross-platform builds for all the varieties of MacOS, let alone other platforms, and the slow adoption into nix packages is by deign - the point of a deterministic build is that you can lock in the versions you require.
So these are not so much drawbacks as mis-alignments with how I approach my computer and computer setup.
What I’ve landed on is mix of brew, chezmoi,
and bash scripts.
You can check it out on github.
Setup process
The setup is run from bootstrap.sh - this installs brew and chezmoi, creates a
brew Bundle file (based on your context home or work) and installed the cofigured
applications. It then sets some initial Hyperkey configs and makes fish the
default shell.
As long as you make changes to your dotfiles inside this repo, and add / remove applications in the Brewfile template, you can maintain your system in line with the configs.
- After changing any files in your dotfiles, run
chezmoi apply - After changing the Brewfile template, run
chezmoi applyand thenbrew bundle --file=~/Brewfile - To upgrade installed applications, run
brew upgrade