Can't install on M2 Pro - Sonoma. Seems to be a permissions issue with a folder.
Having trouble installing nix on a new machine. nix is added to synthetic so I am not sure what the issue is.
Platform
- [ ] Linux:
- [x] macOS - M2 - Sonoma
- [ ] WSL
Additional information
Output
Output
~ sh <(curl -L https://nixos.org/nix/install)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 4052 100 4052 0 0 11137 0 --:--:-- --:--:-- --:--:-- 11137
downloading Nix 2.19.2 binary tarball for aarch64-darwin from 'https://releases.nixos.org/nix/nix-2.19.2/nix-2.19.2-aarch64-darwin.tar.xz' to '/var/folders/ct/xywldskd13q3pff61j959slw0000gn/T/nix-binary-tarball-unpack.XXXXXXXXXX.hcGcjnEnue'...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.9M 100 10.9M 0 0 35.4M 0 --:--:-- --:--:-- --:--:-- 35.4M
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.
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] y
I will:
- make sure your computer doesn't already have Nix files
(if it does, I will tell you how to clean them up.)
- create local users (see the list above for the users I'll make)
- create a local group (nixbld)
- install Nix in to /nix
- create a configuration file in /etc/nix
- set up the "default profile" by creating some Nix-related files in
/var/root
- back up /etc/bashrc to /etc/bashrc.backup-before-nix
- update /etc/bashrc to include some Nix configuration
- back up /etc/zshrc to /etc/zshrc.backup-before-nix
- update /etc/zshrc to include some Nix configuration
- create a Nix volume and a LaunchDaemon to mount it
- create a LaunchDaemon (at /Library/LaunchDaemons/org.nixos.nix-daemon.plist) for nix-daemon
Ready to continue?
[y/n] y
---- 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: disk3s7
uuid: 6B14FF00-8994-4D5F-ACFD-BBA8A4A56FCE
encrypted: no
During install, I add 'nix' to /etc/synthetic.conf, which instructs
macOS to create an empty root directory for mounting the Nix volume.
Can I remove /etc/synthetic.conf?
[y/n] y
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo rm /etc/synthetic.conf
to remove /etc/synthetic.conf
During install, I add '/nix' to /etc/fstab so that macOS knows what
mount options to use for the Nix volume.
Can I remove /etc/fstab?
[y/n] y
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo rm /etc/fstab
to remove /etc/fstab
The installer adds a LaunchDaemon to mount your Nix volume: org.nixos.darwin-store
Can I remove it?
[y/n] y
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo launchctl bootout system/org.nixos.darwin-store
to terminate the daemon
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo rm /Library/LaunchDaemons/org.nixos.darwin-store.plist
to remove the daemon definition
~~> 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/ct/xywldskd13q3pff61j959slw0000gn/T/tmp.iTVGTNH6B3
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
~~> Creating a Nix volume
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/sbin/diskutil unmount force disk3s7
to ensure the Nix volume is not mounted
Volume Nix Store on disk3s7 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
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld1 RealName Nix build user 1
in order to give _nixbld1 a useful note
Note: Nix build user 1
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld2
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld2 RealName Nix build user 2
in order to give _nixbld2 a useful note
Note: Nix build user 2
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld3
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld3 RealName Nix build user 3
in order to give _nixbld3 a useful note
Note: Nix build user 3
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld4
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld4 RealName Nix build user 4
in order to give _nixbld4 a useful note
Note: Nix build user 4
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld5
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld5 RealName Nix build user 5
in order to give _nixbld5 a useful note
Note: Nix build user 5
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld6
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld6 RealName Nix build user 6
in order to give _nixbld6 a useful note
Note: Nix build user 6
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld7
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld7 RealName Nix build user 7
in order to give _nixbld7 a useful note
Note: Nix build user 7
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld8
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld8 RealName Nix build user 8
in order to give _nixbld8 a useful note
Note: Nix build user 8
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld9
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld9 RealName Nix build user 9
in order to give _nixbld9 a useful note
Note: Nix build user 9
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld10
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld10 RealName Nix build user 10
in order to give _nixbld10 a useful note
Note: Nix build user 10
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld11
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld11 RealName Nix build user 11
in order to give _nixbld11 a useful note
Note: Nix build user 11
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld12
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld12 RealName Nix build user 12
in order to give _nixbld12 a useful note
Note: Nix build user 12
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld13
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld13 RealName Nix build user 13
in order to give _nixbld13 a useful note
Note: Nix build user 13
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld14
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld14 RealName Nix build user 14
in order to give _nixbld14 a useful note
Note: Nix build user 14
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld15
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld15 RealName Nix build user 15
in order to give _nixbld15 a useful note
Note: Nix build user 15
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld16
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld16 RealName Nix build user 16
in order to give _nixbld16 a useful note
Note: Nix build user 16
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld17
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld17 RealName Nix build user 17
in order to give _nixbld17 a useful note
Note: Nix build user 17
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld18
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld18 RealName Nix build user 18
in order to give _nixbld18 a useful note
Note: Nix build user 18
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld19
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld19 RealName Nix build user 19
in order to give _nixbld19 a useful note
Note: Nix build user 19
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld20
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld20 RealName Nix build user 20
in order to give _nixbld20 a useful note
Note: Nix build user 20
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld21
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld21 RealName Nix build user 21
in order to give _nixbld21 a useful note
Note: Nix build user 21
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld22
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld22 RealName Nix build user 22
in order to give _nixbld22 a useful note
Note: Nix build user 22
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld23
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld23 RealName Nix build user 23
in order to give _nixbld23 a useful note
Note: Nix build user 23
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld24
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld24 RealName Nix build user 24
in order to give _nixbld24 a useful note
Note: Nix build user 24
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld25
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld25 RealName Nix build user 25
in order to give _nixbld25 a useful note
Note: Nix build user 25
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld26
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld26 RealName Nix build user 26
in order to give _nixbld26 a useful note
Note: Nix build user 26
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld27
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld27 RealName Nix build user 27
in order to give _nixbld27 a useful note
Note: Nix build user 27
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld28
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld28 RealName Nix build user 28
in order to give _nixbld28 a useful note
Note: Nix build user 28
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld29
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld29 RealName Nix build user 29
in order to give _nixbld29 a useful note
Note: Nix build user 29
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld30
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld30 RealName Nix build user 30
in order to give _nixbld30 a useful note
Note: Nix build user 30
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld31
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld31 RealName Nix build user 31
in order to give _nixbld31 a useful note
Note: Nix build user 31
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the build user _nixbld32
Exists: Yes
Hidden: Yes
Home Directory: /var/empty
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/bin/dscl . -create /Users/_nixbld32 RealName Nix build user 32
in order to give _nixbld32 a useful note
Note: Nix build user 32
Logins Disabled: Yes
Member of nixbld: Yes
PrimaryGroupID: 30000
~~> Setting up the basic directory structure
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo /usr/sbin/chown -R root:nixbld /nix
to take root ownership of existing Nix store files
chown: /nix: Read-only file system
---- sudo execution ------------------------------------------------------------
I am executing:
$ sudo install -dv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix /nix/var/nix/db /nix/var/nix/gcroots /nix/var/nix/profiles /nix/var/nix/temproots /nix/var/nix/userpool /nix/var/nix/daemon-socket /nix/var/nix/gcroots/per-user /nix/var/nix/profiles/per-user
to make the basic directory structure of Nix (part 1)
install: chmod 755 /nix: Read-only file system
install: mkdir /nix/var: Read-only file system
---- 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
Or get in touch with the community: https://nixos.org/community
Priorities
Add :+1: to issues you find important.
You say it's a new system, but the output suggests you've had nix installed before and haven't completely uninstalled. (perhaps you ran migration assistant?)
Since the installer isn't fully idempotent anyways, I'd recommend you follow the uninstall instructions before reinstalling it: https://nixos.org/manual/nix/stable/installation/uninstall.html#macos
I did that and had the same result. Even wiped the system...
Can you post the log?
I was having the same experience getting nix installed on MacOS Sonoma (14.3.1), except it was failing at different points. I uninstalled and re-installed about four times, basically cycling these two processes:
- sh <(curl -L https://nixos.org/nix/install)
- https://nixos.org/manual/nix/stable/installation/uninstall.html#macos
Eventually, it succeeded.
I think there's a race condition somewhere. I didn't dig into the code, but it felt like something wasn't quite "ready" in the background. Something like this would probably result in many different-sounding bug reports, all caused by the same thing. Wish I could be more specific, but I thought my experience would help someone identify the issue.