Nixpkgs: macOS Catalina 10.15 Beta

Created on 29 Jun 2019  ·  13Comments  ·  Source: NixOS/nixpkgs

So, I have just updated to macOS 10.15, and my /nix directory is gone. Thanks, apple!

I’ll keep you posted :/.

Most helpful comment

⚠️ The steps above do not work ⚠️

From this comment, we need to avoid symlinking /nix because:

Some builds apparently resolve symlinks, so impure paths end up in build results.

Current instructions are provided toward the bottom of nixos/nix#2925.

All 13 comments

Found it in /Users/Shared/Relocated Items/Security/

So the /Users/Shared/Relocated Items directory seems to contain files that the installer wasn’t sure what to do with. For me it has two directories: Quarantine.lpdf and Security. The first one appears to be a “localised pdf” bundle, and it contains PDFs in multiple languages with the following text:

During your last Upgrade or Migration, some content could not be automatically moved into its expected location. When possible, we've preserved those documents in this folder.

The following conditions occurred:
During the most recent Migration, we had some difficulty transferring certain files. Below is the list of files which encountered problems. Please review this list to see if any of these paths or documents are important to you, and if so, consider transferring them with AirDrop or a USB Stick.

  • Some files from "/private/var/empty" could not be transferred

The Security directory has the entire /nix in it, together with a couple of other files from /usr and /System.

New disk layout:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         250.0 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +250.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD - Data     221.4 GB   disk1s1
   2:                APFS Volume Preboot                 22.9 MB    disk1s2
   3:                APFS Volume Recovery                527.0 MB   disk1s3
   4:                APFS Volume VM                      1.1 GB     disk1s4
   5:                APFS Volume Macintosh HD            10.6 GB    disk1s5
› mount
/dev/disk1s5 on / (apfs, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk1s1 on /System/Volumes/Data (apfs, local, journaled, nobrowse)
/dev/disk1s4 on /private/var/vm (apfs, local, journaled, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)



md5-4879b037f77523f33eff11b99c7ef152



› ls /usr/share
<...>                        snmp                        <...>
› ls /System/Volumes/Data/usr/share
snmp
› sudo touch /System/Volumes/Data/usr/share/hi
› ls /usr/share/hi
ls: /usr/share/hi: No such file or directory
› sudo rm /System/Volumes/Data/usr/share/hi



md5-6cbfccfddf5c44dd539e4f4b1e1f7603



› ls /System/Volumes/Data/usr/local
Caskroom      Cellar        Frameworks    Homebrew      bin           etc           include       lib           lmm           opt           remotedesktop sbin          share         var
› sudo touch /usr/local/hi
› ls /System/Volumes/Data/usr/local/hi
/System/Volumes/Data/usr/local/hi
› sudo rm /System/Volumes/Data/usr/local/hi

Oh, ok, after a reboot / is now mounted read-only. Had to remount it rw to remove all the trash I left there.

In any case, having /nix on the root partition is not longer an option because a) Read-only by default; b) Not enough space anyway.

Aha, the relevant keywords seem to be “Volume Group” (see man diskutil) and “Firmlink”.
(This issue is turning into a non-Nix-specific macOS digging thing...)

› diskutil ap listGroups
APFS Container (1 found)
|
+-- Container disk1 1CB0B9F2-E0E6-47B1-8A0D-69F58A82A8D4
    |
    +-> Volume Group E1343DAE-B8CD-300B-B768-DAB4D057FD9D
        =================================================
        APFS Volume Disk (Role):   disk1s1 (Data)
        Name:                      Macintosh HD - Data
        Volume UUID:               E1343DAE-B8CD-300B-B768-DAB4D057FD9D
        Capacity Consumed:         221868994560 B (221.9 GB)
        -------------------------------------------------
        APFS Volume Disk (Role):   disk1s5 (System)
        Name:                      Macintosh HD
        Volume UUID:               AA6B623F-23C7-4CFF-A5EC-F275B26FB6E4
        Capacity Consumed:         10322522112 B (10.3 GB)

AHA!

› cat /usr/share/firmlinks
/AppleInternal  AppleInternal
/Applications   Applications
/Library    Library
/System/Library/Caches  System/Library/Caches
/System/Library/Assets  System/Library/Assets
/System/Library/PreinstalledAssets  System/Library/PreinstalledAssets
/System/Library/AssetsV2    System/Library/AssetsV2
/System/Library/PreinstalledAssetsV2    System/Library/PreinstalledAssetsV2
/System/Library/CoreServices/CoreTypes.bundle/Contents/Library  System/Library/CoreServices/CoreTypes.bundle/Contents/Library
/System/Library/Speech  System/Library/Speech
/Users  Users
/Volumes    Volumes
/cores  cores
/home   home
/mnt    mnt
/opt    opt
/private    private
/sw sw
/usr/local  usr/local
/usr/libexec/cups   usr/libexec/cups
/usr/share/snmp usr/share/snmp

Question: Can firmlinks be created by endusers, or are they reserved to the system? If they can be created by the enduser, what commands are used to create them?

Answer: No, firmlinks can't be created by endusers. This is reserved currently to the system. There will be synthetic firmlinks coming, which can be used as mount points for network resources.

(from here)

Ok, cool, we are fucked 😒.

Time to move /nix to /opt/nix? 🤷‍♂

(cc @LnL7 @copumpkin @dhess @matthewbauer) (sorry if I forgot someone who might be interested)

Ah, thanks, then, I guess, I’ll close this one.

So, for future reference, the steps to recover after an upgrade are:

  1. mv "/Users/Shared/Relocated Items/Security/nix" /opt/
  2. sudo mount -o rw / (this throws errors but works)
  3. ln -s /opt/nix /nix

⚠️ The steps above do not work ⚠️

From this comment, we need to avoid symlinking /nix because:

Some builds apparently resolve symlinks, so impure paths end up in build results.

Current instructions are provided toward the bottom of nixos/nix#2925.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThomasMader picture ThomasMader  ·  65Comments

fdietze picture fdietze  ·  144Comments

worldofpeace picture worldofpeace  ·  103Comments

globin picture globin  ·  65Comments

samueldr picture samueldr  ·  88Comments