Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After restoring from a Time Machine backup, I can no longer reinstall Nix #11323

Closed
1 of 3 tasks
ivyjsgit opened this issue Aug 17, 2024 · 3 comments
Closed
1 of 3 tasks

Comments

@ivyjsgit
Copy link

ivyjsgit commented Aug 17, 2024

Platform

  • Linux:
  • macOS
  • WSL

Additional information

I've recently restored my Mac from a Time Machine backup using recovery assistant. I had to reinstall nix because for some reason it wasn't installed properly anymore.

I've tried deleting the users that it complains about using dscl, but I am not able to continue through the script because it continues to complain about the users existing

Output

Output
---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo launchctl kickstart -k system/org.nixos.darwin-store

to launch the Nix volume mounter


~~> Setting up the build group nixbld
            Exists:	Yes

~~> Setting up the build user _nixbld1

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

If you already created the users and you know they start from
 and go up from there, you can edit this script and change
NIX_FIRST_BUILD_UID near the top of the file to  and try
again.

We'd love to help if you need it.

You can open an issue at
https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md

Or get in touch with the community: https://nixos.org/community

Priorities

Add 👍 to issues you find important.

@ivyjsgit ivyjsgit changed the title After restoring from a Time Machine backup, I can no longer reinstall NixOS After restoring from a Time Machine backup, I can no longer reinstall Nix Aug 17, 2024
@ivyjsgit
Copy link
Author

To fix this, I had to
change the NIX_FIRST_BUILD_UID in install-darwin-multi-user.sh to read

export NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-600}"

instead of

export NIX_FIRST_BUILD_UID="${NIX_FIRST_BUILD_UID:-301}"

and then I had to redelete all nix users

@abathur
Copy link
Member

abathur commented Aug 17, 2024

The error message isn't exactly the same, but this may be related (or at least similar) to a known problem with macOS not cleanly migrating users and groups when people set up a new system with Migration Assistant:

This might also be related to an issue where the same error has been reported (but none of them mentioned migration/recovery, and I don't think we've isolated a cause yet):

Since you've already tried to reinstall, I'd recommend (if you encounter any more trouble, I guess) just following uninstall instructions before reinstalling it: https://nixos.org/manual/nix/stable/installation/uninstall.html#macos

@tomberek
Copy link
Contributor

Closing as duplicate, feel free to reach out if you need more help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants