With Nix 2.4, the install script for macOS no longer supports single-user installations. I think that’s a shame, as single-user install was one of the primary reasons I loved using Nix. Not needing to give a random install script from the internet sudo
access was also a requirement for me to feel comfortable recommending Nix to people who don’t know it yet.
First of all, I do want to recognize the tremendous work that went into making the macOS install automated post-Catalina. I understand how hard that was, and I am by no means trying to undermine or underestimate the work that went into that. I also understand that setting up a volume for the user (as well as the configuration necessary to get that volume mounted early on in the OS boot process) requires sudo
access and arguably major system changes, and I can see the reasoning that leads from that point to a multi-user install.
However, I don’t want a multi-user install. I’m willing to be convinced otherwise (hence this post), so here are the reasons why I currently prefer single-user:
- From a security perspective, I can’t imagine any benefit to giving the Nix installer
sudo
access: single-user runs everything as my user, with no need forsudo
at any point (assuming I arrange to start the install process with a writable-to-my-user/nix
, which is a burden I’m willing to bear). That seems inherently safer than running the Nix install process withsudo
access. I’m told there is “sandboxing”, but it’s unclear whether that applies to macOS, and besides, I don’t really see the point: if I don’t trust the build process of a Nix expression to run as my user, why should I trust the resulting binary either? - From a performance perspective (I have a very vague understanding that there may be more parallelism going on with multi-user), I just don’t care: I use Nix to provide me with stable binaries for tools I use, i.e. as a package manager and not as a build system. Therefore they change fairly infrequently and are usually available as binaries I can just download, so I’m happy to wait for packages to “build” when needed.
- The multi-install seems a lot more invasive to my system: it creates new users and changes system files. It’s also pretty unclear from the docs how to uninstall it cleanly. The single-user install writes to well-defined directories under
$HOME
and to/nix
, so it’s easy to wipe out if I want.
I understand why the installer might want to default to a multi-user install in a post-Catalina world, since in most cases you’d need to setup the volume anyway. But if there is already a writeable /nix
, it would be nice if the installer could use that to allow for a single-user install.
So, convince me: what am I missing? What is wrong with the way I’m currently thinking about it? What are the advantages of a multi-user install that may balance out what I see as drawbacks? What am I misunderstanding for a drawback but is actually a good thing somehow?