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

Installing NIX on macOS fails (actually a re-install) #11679

Closed
2 tasks
JimCarbistry opened this issue Oct 11, 2024 · 2 comments
Closed
2 tasks

Installing NIX on macOS fails (actually a re-install) #11679

JimCarbistry opened this issue Oct 11, 2024 · 2 comments

Comments

@JimCarbistry
Copy link

Platform

  • Linux:
  • [X ] macOS
  • WSL

Additional information

I had NIX running at one point and had a working Holochain playground and agents running. Then upgraded my Mac to Sequoia this week and when I tried to get things running again, NIX was not found. I tried to re-install it but got stopped at bashrc back up step. Resolved that and tried again, the script made it all the way to Creating the NIX build user and then stopped because DS Error: -14135 (eDSREcordAlreadyExists). I tried finding the _nixbld1 id to delete it but had no luck.

I have pasted in below all of the information displayed on the terminal during the failed installation process.

Output

Output

jims@Jims-MacBook-Pro cargo-bike % bash <(curl https://holochain.github.io/holochain/setup.sh)

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1606  100  1606    0     0  27286      0 --:--:-- --:--:-- --:--:-- 27689
Nix package manager not found
Installing Nix

bash /dev/fd/63 --daemon
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4267  100  4267    0     0  42649      0 --:--:-- --:--:-- --:--:-- 43101
downloading Nix 2.23.0 binary tarball for x86_64-darwin from 'https://releases.nixos.org/nix/nix-2.23.0/nix-2.23.0-x86_64-darwin.tar.xz' to '/var/folders/nk/b8n92nv970l__zz2wz23gd7m0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.gLWXtwKhOO'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15.0M  100 15.0M    0     0  28.8M      0 --:--:-- --:--:-- --:--:-- 28.8M
Switching to the Multi-user Installer
Welcome to the Multi-User Nix Installation

This installation tool will set up your computer with the Nix package
manager. This will happen in a few stages:

1. Make sure your computer doesn't already have Nix. If it does, I
   will show you instructions on how to clean up your old install.

2. Show you what I am going to install and where. Then I will ask
   if you are ready to continue.

3. Create the system users (uids [301..332]) and groups (gid 30000)
   that the Nix daemon uses to run builds. To create system users
   in a different range, exit and run this tool again with
   NIX_FIRST_BUILD_UID set.

4. Perform the basic installation of the Nix files daemon.

5. Configure your shell to import special Nix Profile files, so you
   can use Nix.

6. Start the Nix daemon.

Would you like to see a more detailed list of what I will do?
[y/n] n


---- let's talk about sudo -----------------------------------------------------
This script is going to call sudo a lot. Every time I do, it'll
output exactly what it'll do, and why.

Just like this:

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

    $ sudo echo

to demonstrate how our sudo prompts look


This might look scary, but everything can be undone by running just a
few commands. I used to ask you to confirm each time sudo ran, but it
was too many times. Instead, I'll just ask you this one time:

Can I use sudo?
[y/n] y

Yay! Thanks! Let's get going!

~~> Fixing any leftover Nix volume state
Before I try to install, I'll check for any existing Nix volume config
and ask for your permission to remove it (so that the installer can
start fresh). I'll also ask for permission to fix any issues I spot.

---- Found existing Nix volume -------------------------------------------------
  special:	disk1s7
     uuid:	B3AFF4A4-864B-4016-8ED7-5E923AD3A36F
encrypted:	no

~~> Checking for artifacts of previous installs
Before I try to install, I'll check for signs Nix already is or has
been installed on this system.

---- Nix config report ---------------------------------------------------------
        Temp Dir:	/var/folders/nk/b8n92nv970l__zz2wz23gd7m0000gn/T/tmp.jMwfEIdTDO
        Nix Root:	/nix
     Build Users:	32
  Build Group ID:	30000
Build Group Name:	nixbld

build users:
    Username:	UID
     _nixbld1:	301
     _nixbld2:	302
     _nixbld3:	303
     _nixbld4:	304
     _nixbld5:	305
     _nixbld6:	306
     _nixbld7:	307
     _nixbld8:	308
     _nixbld9:	309
     _nixbld10:	310
     _nixbld11:	311
     _nixbld12:	312
     _nixbld13:	313
     _nixbld14:	314
     _nixbld15:	315
     _nixbld16:	316
     _nixbld17:	317
     _nixbld18:	318
     _nixbld19:	319
     _nixbld20:	320
     _nixbld21:	321
     _nixbld22:	322
     _nixbld23:	323
     _nixbld24:	324
     _nixbld25:	325
     _nixbld26:	326
     _nixbld27:	327
     _nixbld28:	328
     _nixbld29:	329
     _nixbld30:	330
     _nixbld31:	331
     _nixbld32:	332

Ready to continue?
[y/n] y


---- Preparing a Nix volume ----------------------------------------------------
    Nix traditionally stores its data in the root directory /nix, but
    macOS now (starting in 10.15 Catalina) has a read-only root directory.
    To support Nix, I will create a volume and configure macOS to mount it
    at /nix.

~~> Configuring /etc/synthetic.conf to make a mount-point at /nix

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

    $ sudo /usr/bin/ex -u NONE -n /etc/synthetic.conf

to add Nix to /etc/synthetic.conf

Password:

~~> Creating a Nix volume

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

    $ sudo /usr/sbin/diskutil unmount force disk1s7

to ensure the Nix volume is not mounted

Volume Nix Store on disk1s7 force-unmounted

~~> Configuring /etc/fstab to specify volume mount options

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

    $ sudo /usr/sbin/vifs

to add nix to fstab


~~> Configuring LaunchDaemon to mount 'Nix Store'

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

    $ sudo /usr/bin/ex -u NONE -n /Library/LaunchDaemons/org.nixos.darwin-store.plist

to install the Nix volume mounter


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

    $ sudo launchctl bootstrap system /Library/LaunchDaemons/org.nixos.darwin-store.plist

to launch the Nix volume mounter


---- 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

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

    $ sudo /usr/bin/dscl . create /Users/_nixbld1 UniqueID 301

Creating the Nix build user (#1), _nixbld1

<main> attribute status: eDSRecordAlreadyExists
<dscl_cmd> DS Error: -14135 (eDSRecordAlreadyExists)

---- oh no! --------------------------------------------------------------------
Oh no, something went wrong. If you can take all the output and open
an issue, we'd love to fix the problem so nobody else has this issue.

:(

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

Priorities

Add 👍 to issues you find important.

@abathur
Copy link
Member

abathur commented Oct 11, 2024

At this point I'd recommend following the uninstall instructions (https://nixos.org/manual/nix/stable/installation/uninstall.html#macos) before reinstalling nix directly.

It sounds like holochain's installer in turn uses an old version of the nix installer that isn't patched for Sequoia support. (but it sounds like it'll take whatever you're using if you install nix before running it).

For future reference: when you said "nix was not found" after the update, this likely means that you're using zsh and the macos update overwrote nix's zsh shell hook. You'll see this on future updates, but you can just replace it manually after.

If you're curious:

You may also want to holler at the holochain folks about improving this on their end :)

@JimCarbistry
Copy link
Author

Many Thanks! Following the uninstall instructions and then installing nix directly worked.

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

2 participants