With no surprise the end of one year marks the start of the next. And the beginning of a year is always synonymous with… a fresh macOS system! But managing a good working environment on macOS has long been a game of “hope for the best.” We’ve all been there: a curl | sh here, a manual brew install there, and six months later, you’re staring at a broken PATH and a Python environment that seems to have developed its own consciousness. I’ve spent a lot of time recently moving my entire workflow into a declarative system using nix. From my zsh setup to my odin toolchain, here is why the transition from the imperative world of Homebrew to the immutable world of nix-darwin has been both a revelation and a fight. The problem to solve: imperative rot # Homebrew is great. From the Linux world, it was the perfect missing package manager for macOS at first, promoted by a lot of developers, and it (mostly) works. But Homebrew has a problem: it is imperative. When you run brew install you are changing the state of your machine in a way that is difficult to reverse or replicate exactly. As an example, if I set up a new Mac today, brew install neovim might give me version 0.10. However, if I do it six months from now, the version might changed and I had to reconfigure some components because of that change. The consequence is me, spending a few hours debugging my environment instead of writing code. A solution to that is postfix every brew package by its version, but this is not possible for every package. Another solution is system immutability and the Nix store. System immutablility, and the Nix store # Nix approaches the problem from a functional programming perspective. Your system is not a collection of side effects, but a pure function of your configuration. This allows different strong points like: reproducibility: Every package lives in /nix/store with a unique hash. This means I can have three different versions of the Odin compiler side-by-side, and they will never see e...
First seen: 2026-01-02 09:14
Last seen: 2026-01-02 20:15