NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.47k stars 1.44k forks source link

Creating Nix user on MacOS #10921

Open stepaniukm opened 2 weeks ago

stepaniukm commented 2 weeks ago

Platform

Additional information

Output

Output ```log ---- Nix config report --------------------------------------------------------- Temp Dir: /var/folders/yz/p4nss_t92n58b8mpjrvpb7vw0000gn/T/tmp.TcJ6IhU3yB 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: Sorry, try again. Password: ~~> Creating a Nix volume ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/diskutil apfs addVolume disk3 APFS Nix Store -nomount to create a new APFS volume 'Nix Store' on disk3 ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/diskutil unmount force disk3s7 to ensure the Nix volume is not mounted disk3s7 was already unmounted ~~> Configuring /etc/fstab to specify volume mount options ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/vifs to add nix to fstab ~~> Encrypt the Nix volume ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/diskutil mount Nix Store to mount your Nix volume for encrypting Volume Nix Store on Nix Store mounted ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/bin/security -i to add your Nix volume's password to Keychain ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/diskutil apfs encryptVolume Nix Store -user disk -stdinpassphrase to actually encrypt your Nix volume Encrypting with the new "Disk" crypto user on disk3s7 The new "Disk" user will be the only one who has initial access to disk3s7 The new APFS crypto user UUID will be DC102B15-6D98-4D1B-A833-50B12DF22E0C Encryption has likely completed due to AES hardware; see "diskutil apfs list" ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/diskutil unmount force Nix Store to unmount the encrypted volume Volume Nix Store on disk3s7 force-unmounted ~~> 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 ---- sudo execution ------------------------------------------------------------ I am executing: $ sudo /usr/sbin/dseditgroup -o create -r Nix build group for nix-daemon -i 30000 nixbld Create the Nix build group, nixbld Created: 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
attribute status: eDSRecordAlreadyExists DS Error: -14135 (eDSRecordAlreadyExists) ---- oh no! -------------------------------------------------------------------- ```

Priorities

Add :+1: to issues you find important.

cole-h commented 2 weeks ago

Are you using the new macOS 15 beta?

If so, this sounds like https://github.com/NixOS/nix/issues/10892. Fresh installs can use the workaround in https://github.com/NixOS/nix/issues/10892#issuecomment-2163311876.