Going immutable on macOS

Speaking of NixOS’ use of 9P, what if you want to, for whatever inexplicable reason, use macOS, but make it immutable? Immutable Linux distributions are getting a lot of attention lately, and similar concepts are used by Android and iOS, so it makes sense for people stuck on macOS to want similar functionality. Apple doesn’t offer anything to make this happen, but of course, there’s always Nix.

And I literally do mean always. Only try out Nix if you’re willing to first be sucked into a pit of despair and madness before coming out enlightened on the other end – I managed to only narrowly avoid this very thing happening to me last year, so be advised. Nix is no laughing matter.

Anyway, yes, you can use Nix to make macOS immutable.

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.

↫ Carette Antonin

Of course it’s been a fight – it’s Nix, after all – but it’s quite impressive and awesome that Nix can be used in this way. I would rather discover what electricity from light sockets tastes like than descend into this particular flavour of Nix madness, but if you’re really sick of macOS being a pile of trash for – among a lot of other things – homebrew and similar bolted-on systems held together by duct tape and spit, this might be a solution for you.

Leave a Reply