-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
/nix will not be writable on macOS Catalina #2925
Comments
Realistically, this may force us to drop support for macOS. Using a different store location for macOS would require a separate binary cache and a separate Hydra instance, and there would be no guarantee that the new location wouldn't break in the future. I did notice in the talk that it's still possible to make the system volume writable, though not in a persistent way. |
Speaking for myself: I would be quite sad if macOS support would go away. Yes, you can jump through hoops and get a writable system volume, but only until the next reboot, so this is not a useful option. |
@edolstra Before canceling support, we can ask the community if it's willing to host its own binary cache and Hydra instance, just as we've enlisted a host of volunteers to keep nixpkgs at near parity on Darwin. Having the answer be, "This doesn't easily fit our model so we won't support Mac" would be an unfortunate response. |
I think no such decision should be made lightly, but it is definitely a drastic change on Apple’s part. |
Maybe you can use this to create a |
That was my first try to get it temporarily working again. But
If that error can be safely ignored, I think this would be a workaround worth exploring. The way I understand things, anything you place in the root folder would persist until the next system update. |
There's no real reason for the nix store to be on the system volume, with apfs it's easy to create a separate volume and mount it to |
@mroi You can set |
@edolstra Thanks for the tip, this is a useful workaround. But future Nix-users on macOS still need to find a reliable way to inject this symlink into the read-only root directory. This probably involves some advanced steps like rebooting into recovery mode after every system upgrade. @LnL7 The same would be true for |
Sure but if Apple doesn't want to provide some sort of solution for one of these cases there will be no alternative to changing the default prefix. Which is arguably is not worth it for a secondary platform that's continuously moving further away from UNIX. Is there an overview of the full volume layout somewhere? |
@mroi How have you been testing this? In my testing, I was able to install nix, but I assumed it was due to the comment in the presentation that "system volume is writeable in the developer preview". I'd also like to help test, but was able to get nix installed:
|
It looks like you can still access the |
|
I wonder if that will continue to work in the later builds, when they plan to enforce the read-only aspect. |
Apple says in the WWDC talk, that the first beta seeds mount the system volume read-write, but this is only temporary. A later seed will turn it read-only. You can create a file |
But there is good news. I talked to an Apple engineer on Twitter and they are working on a solution to create symlinks in the root directory even when the system volume is mounted read-only. I guess we’ll just wait and see how this turns out. For now, symlinking |
@grahamc remember our discussion about symlink |
This appears to be fixed in 10.15 Beta 3! I can create a /nix directory and use it as a store, while /System, /bin, /sbin, etc. are still read only. Users upgrading from previous beta versions can do:
then start the daemon if you are in multi user:
New installs should work out of the box. |
|
Will |
If you disable SIP, yes. |
Ugh, I don't think we want to recommend that. Are any exceptions for Nix possible? I saw that Fink's To be clear, changing the root directory of Nix from |
We're working on something that will allow you to create either a symlink or empty directory at
|
Sounds reasonable! The main concern with (1) is that realpath(3) will still report /System/Volumes/Data/nix when pwd=/nix (#2926). That can get |
If we were to mount Nix from a separate volume, we could use the opportunity to use the case-sensitive version of APFS. This would remove the need to fix weirdo packages relying on files that just differ in case. |
I never object to a change which spreads the case-sensitivity gospel. |
I have been doing this with great success (although with hfs+ case sensitive) with an external ssd for a while now. The primary motivation being, that I can take my nix store from my desktop with me when I use my laptop while walking about. |
I use this script to create volumes in semi-automated fashion with FileVault enabled:
sudo diskutil apfs addVolume disk1 APFSX Nix -mountpoint /nix
sudo diskutil enableOwnership /nix
echo $PASSPHRASE | sudo diskutil apfs encrypt /nix -user disk -stdinpassphrase
echo $PASSPHRASE | sudo diskutil apfs encrypt /nix -user $CRYPTO_USER -stdinpassphrase
sudo chflags hidden /nix
echo 'LABEL=Nix /nix apfs rw' tee -a /etc/fstab
UUID=$(diskutil info -plist /nix | plutil -extract VolumeUUID xml1 - -o - | plutil -p - | sed -e 's/"//g')
security add-generic-password -l Nix -a "$UUID" -s "$UUID" -D "Encrypted Volume Password" -w "$PASSPHRASE" \
-T "/System/Library/CoreServices/APFSUserAgent" -T "/System/Library/CoreServices/CSUserAgent" Same for
|
This is pretty complicated just for trying to install a package manager. Any ETA on when the installer instructions themselves will be "fixed"? I don't necessarily want to dive into all of these details and would prefer something that "just works". |
It may be a bit complicated but it is not exactly helped by people continuing to post the same things over and over again. Some comment (now swallowed up, never to be seen again) foreshadowed exactly this and warned against it |
Yes, someone predicted this was going to be a problem with the OS update that was released months ago. They even did so during the "beta" phase which offered plenty of time to get ahead of the problem and fix the installation at the main landing page where people from all over the world are continually landing to this day. :) |
No, it was this comment: #2925 (comment) and it was right |
I was thinking of a different (and earlier one) obviously. Perhaps on a completely different issue that I went through before landing here. |
And that's still ridiculously complicated. I would say that your software project is failing if it requires reading a wall of text and issuing lots of volume-based commands just to get a basic installation complete. Major fail in fact. |
@druimalban @johanatan will it be sane to offer interactive script to setup raw/encrypted volumes for a single user installation? |
Unsubscribing here for the time being. Somebody let me know when this is usable for a casual macOS user because this does not seem like it. |
This limbo is frustrating from every angle, but we won't get anywhere good by venting at people (even, I suppose, at Apple?) Having enjoyed using Nix on macOS over the past 2+ years, it's frustrating to see this keep away prospective users. That said, it's also abnormal for a "basic installation" to have to go create new volumes (let alone encrypted ones) and I think we'd be in an even worse place if the installer was out in the wild doing it in a half-baked way. |
This installer is out in the wild doing things in a half-baked way. I have no idea the state of my system in fact nor do I have any way to completely erase whatever Nix did to it. |
Did you follow the removal steps you quoted in #2925 (comment)? |
Not yet. That's the first I've heard of any "removal steps". I didn't read that comment in detail yet--just saw a wall of text and said "that'll have to wait until later". |
What's the status on this issue? The website and installer are quite misleading in the sense that they still claim complete compatibility with macOS. Is there a path forward to using Nix on macOS without any hacks? |
@samuela macOS does not allow simply creating /nix. So that needs to be configured in some way, not really a "hack". The easiest way to have Nix on macOS would be if Nix used /opt/nix or /usr/local/nix instead of /nix. |
So what is the problem with |
@samuela it means either doubling the storage for Hydra, or changing ALL the Nix installs everywhere. One hacky option is to rewrite store paths as they get downloaded. So any mention of |
@wmertens How much storage would get doubled? |
@alper any package that Hydra produces would have to be produced twice, once for /nix and once for /opt/nix. It's not quite a doubling, because not all packages are built for Darwin and files that don't reference store paths would likely be the same and can be hardlinked. I don't know how big the Hydra storage is. |
Seeing as this issue has been open since 2019, it seems as though macOS is no longer a supported platform. Is that true? Or is there a roadmap to fixing this? |
Because shouldn’t storage be a non-issue at this point in history? |
I'm going to lock this until we're able to get a fix out. Thanks for everybody's contributions and help in figuring out this problem, hopefully it is soon. |
@wmertens We wouldn't need to produce packages twice, since we'd have one Hydra instance (and binary cache) for macOS (using the /opt prefix) and another instance for all other platforms. The main consequence of using a separate prefix for macOS is that you can't have Hydra jobsets anymore containing jobs for macOS and Linux. It would also make it harder to deploy from macOS to Linux. |
Documentation for installation of Nix on Catalina is available. Note that until Nix 2.3.5 release is out, the instructions won't work. PR |
Nix 2.3.5 has been released with Catalina fix! |
This is not a short term bug, but it will become an issue when macOS Catalina is released this fall. macOS is now split across two volumes (system and data) with a read-only system volume. This means that
/nix
will no longer be writable.Some more information can be found in the related WWDC talk and some session notes people took from a Q&A.
Summary: the system volume, which is mounted at
/
will become non-writable. Some directories that need to be writable are connected via firmlinks (an Apple invention) to the data volume./nix
is not among these locations, so with the release of macOS Catalina, this location is no longer an option.I see two possible solutions:
/nix
as a firmlink to a writable location. I think this has limited success and Nix would then depend on Apple to not drop this link in a future release./usr/local
and/opt
, so we could move to/usr/local/nix
or/opt/nix
. I would hope that these locations are common enough so that Apple would not drop them in the future.I wanted to raise this issue early, before it becomes a problem for users. If this issue tracker is not the right place, please feel free to move this discussion elsewhere. I would also be available for testing any potential solution, since I have access to a macOS Catalina beta.
The text was updated successfully, but these errors were encountered: