Open the install script and comment the lines (the if statement)
for multiuser Darwin setup. In that particular version the lines
are 26-35.

Create the /nix directory (sudo mkdir /nix) and change the
ownerwhip to yourself (sudo chown youruserid /nix). Those are the
only commands you need sudo rights for.

run the install script ./install

I have been playing with the Nix package
manager lately (I will write more about it
some other time). On macOS, Nix mandatorily installs itself in
“multi-user mode” in macOS, which means that the build/install process
is actually run under central control by a set of special build
accounts. This allows concurrent users to build packages without
breaking things, but for a single-user system like mine, it doesn’t
add much value. Furthermore, it was inconvenient because my
command-line proxy settings (i.e. the http_proxy and related
environment variables) did not get properly picked up by the daemon
when it changed dynamically, as it does often through the day as I
move between home, office and other networks.

So, with the help of several nice people on the ##nix-darwin IRC
channel, I figured out how to revert my installation to single-user
Nix mode. Here it is:

Install and configure Nix as
documented, or like I
did, with brew cask install nix (I know—the irony of using
Homebrew to install Nix!)

Change the ownership of the entire /nix directory to your
personal user:

chown -R yourusername /nix

Change your configuration to unset the NIX_REMOTE environment
variable. This is set automatically if you use bash because the Nix
installation adds it to /etc/profile, so you will have to unset it
manually in your own configuration, or modify the system files (I
leave that part up to you according to your setup). I use the Elvish
shell, so you can use my nix.elv
library,
which I load from my
rc.elv
file like this:

# Set up Nix environment
use nix
nix:multi-user-setup
# Work without the daemon
E:NIX_REMOTE =""

Remove the following line from /etc/nix/nix.conf:

build-users-group = nixbld

That’s it! You should now be able to run nix-env and all other Nix
commands and they will operate directly, without going through the
daemon.

Once you are convinced that things are working fine, and to fully
cleanup the multi-user install, you can remove the Nix build group and
users with these commands: