Skip to content

Instantly share code, notes, and snippets.

@idleberg
Last active October 6, 2025 12:21
Show Gist options
  • Select an option

  • Save idleberg/ecf2d5f7675ec1b5b7785bbfbc15d223 to your computer and use it in GitHub Desktop.

Select an option

Save idleberg/ecf2d5f7675ec1b5b7785bbfbc15d223 to your computer and use it in GitHub Desktop.
Nix Reinstallation Error

When trying to reinstall Nix using the official installer, you might run into the following error (the UID might vary)

---- oh no! --------------------------------------------------------------------
It seems the build group nixbld already exists, but
with the UID 30000. This script can't really handle
that right now, so I'm going to give up.

You can export NIX_BUILD_GROUP_ID=30000 and re-run.

In my case, exporting NIX_BUILD_GROUP_ID did not change anything. What did work is deleting build users created by a previous installation (via). Since I will never find that issue again, I'm publishing it on Gist with annotations added by myself.

# Nix creates multiple build users to perform package builds in isolation, let's iterate over them
for i in {1..32}; do
    # Delete each Nix build user (_nixbld1, _nixbld2, etc.)
    sudo dscl . delete /Users/_nixbld$i
done

# Delete the Nix build group
sudo dscl . delete /Groups/nixbld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment