-
-
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 daemon fails to start on macOS 10.15 Catalina #3125
Comments
Isn’t this issue supposed to be fixed by 800fba1? |
That commit is a necessary but incomplete fix. It only ensures that But if launchd can't read This fails because the multi-user installer symlinks the plist, and that symlink is broken if |
Damn. Thanks for clearing this up. |
How reasonable would it be to just copy the plist instead of symlinking it? |
Yeah missed this one. Copying the file would be necessary unfortunately. The reason we do the symlink is to get updates automatically for Nix. Migration step would be:
|
On Catalina, the /nix filesystem might not be mounted at start time. To avoid this service not starting, we need to keep the launch agent outside of the Nix store. A wait4pid will hold for our /nix dir to be mounted. Fixes NixOS#3125.
Opened #3128 |
Although this issue is closed, I wanted to mention that the installation fails with the copy command, in case the target file exists. I got the following error:
Maybe it would be safer to remove the file and then do the copy. |
Is that a fatal error? If so, that sounds like the sane thing to do. |
i also hit this, but I don't think it should be fatal. It's a leftover from previous installation and can be just copied over. |
It would be better to use |
Describe the bug
The Nix daemon does not start after boot for multi-user installations on macOS 10.15 (Catalina).
To Reproduce
Prepare macOS 10.15 (Catalina) for Nix:
echo 'nix' | sudo tee -a /etc/synthetic.conf
Reboot
Create the Nix volume:
Install Nix with
sh <(curl https://nixos.org/nix/install) --daemon
Reboot
Observed behavior
Nix stops working after reboot; commands fail with:
Similarly, the Nix daemon is not seen by launchd:
launchctl list | grep nix
finds nothing.Root Cause
Nix installs
/Library/LaunchDaemons/org.nixos.nix-daemon.plist
as a symlink into the Nix store.At boot, launchd sees this as a dangling symlink as the Nix volume is not mounted early enough. Thus, it is unable to load the plist, and the nix daemon does not start.
Workaround
You can manually start the daemon after each boot with
launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && launchctl start org.nixos.nix-daemon
.Alternatively, manually copy the plist into
/Library/LaunchDaemons
, replacing the symlink with an actual copy of the file.If you do the latter, you may want to adjust the paths inside the plist to point to
/nix/var/nix/profiles/default/bin/nix-daemon
rather than a specific derivation inside the Nix store.Metadata
"x86_64-darwin"
Darwin 19.0.0, macOS 10.15
yes
no
nix-env (Nix) 2.3
"nixpkgs-20.03pre194957.bef773ed53f"
/nix/var/nix/profiles/per-user/root/channels/nixpkgs
The text was updated successfully, but these errors were encountered: