Ian on the Internet

Moving to Nix

Some time after fixing my Neovim config, I decided to follow up on early search result hints that maybe I should be using Nix instead of Homebrew to manage my configuration. I think the catalyst was two HackerNews posts that crossed my feed recently:

Anyway, I went to Back Market and ordered myself a refurbished MacBook Pro with an M2 chip in it and set about installing NixOS on it. The installation went a lot more smoothly than I was expecting but I immediately faced analysis paralysis when it came to actually configuring the thing. I decided to simplify a bit and start by using nix-darwin to configure a dev environment on the macOS partition that the NixOS install leaves behind. As it is, that's a rather daunting set of decisions to make.

I ended up settling on the following configuration:

The experience with nix-darwin has been mixed-but-positive. There's a lot of documentation out there but it's of highly variable quality with a lot of cargo-culted copypasta. I found it a bit overwhelming to research everything myself and stooped to asking Claude for help. I was actually pleasantly surprised how useful the free Claude web UI was (using Sonnet 5 in "medium" thinking mode). Here are the conversations I've had with Claude so far, in roughly chronological order:

There are probably a whole bunch of things I'll be tweaking in this configuration over the next months and years, and I'm not even sure what will come next. For sure, though, I'll need to address the warnings I get when I run home-manager switch; there's some problem with the way I've configured Nixvim and I haven't been able to figure out how to fix it so I'll probably ask Claude again. Meanwhile, I'm working on configuring a nix develop shell for Sendosio, the previous nerd-snipe on my stack of nerd-snipes. I've got Clang 22 and cmake --workflow llvm-debug working in my Nix-managed macOS environment, but my attempts to use Google's Gemini to help me get GCC 16 working (which would give me access to C++26 reflection to explore a new nerd-snipe) failed miserably. I'm curious whether GCC 16 would be easier to get working on the NixOS install on this machine because work-arounds like Skarn's PR handling __need_rsize_t in Iain Sandoe's Darwin-focused branch of GCC would be unnecessary, but I'm going to resist temptation and pop my stack rather than pushing again.

#development #documentation #nix #nix-darwin