# macOS upgrade breakage

**URL:** https://discourse.nixos.org/t/macos-upgrade-breakage/50691
**Category:** Help
**Created:** [August 16, 2024, 12:02pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691 "2024-08-16T12:02:58Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![badger](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@badger](https://discourse.nixos.org/u/badger)
#### Post date: [August 16, 2024, 12:02pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/1 "2024-08-16T12:02:58Z")

</div>

So after years without a problem, I’ve finally hit a “macOS upgrade breaks my nix” problem, with Sonoma 14.6.1 on apple silicon, but it doesn’t seem to fit a pattern I’ve found by searching.

The problem is that the two `/Library/LaunchDaemons/org.nixos.*` services seem to be forgotten by launchd somehow after a reboot. The files are still correctly there, but after a reboot, `launchctl print system/org.nixos.darwin-store` (or `system/org.nixos.nix-daemon`) fails with:

```auto
Bad request.
Could not find service "org.nixos.darwin-store" in domain for system

```

and `sudo launchctl kickstart -k system/org.nixos.darwin-store` fails with `Could not find service "org.nixos.darwin-store" in domain for system` (same for nix-daemon).

If I manually run this after reboot, everything fully works:

```auto
sudo launchctl bootstrap system /Library/LaunchDaemons/org.nixos.darwin-store.plist
sudo launchctl bootstrap system /Library/LaunchDaemons/org.nixos.nix-daemon.plist
sudo launchctl kickstart -k system/org.nixos.darwin-store
sudo launchctl kickstart -k system/org.nixos.nix-daemon

```

but then the next reboot still fails.

Does anyone have any tips for getting the `launchctl bootstrap` to persist, like it has done for every previous version of macOS on this machine?

---

<div class="post-metadata">

### Author: ![fabianh](https://discourse.nixos.org/user_avatar/discourse.nixos.org/fabianh/32/3280_2.png) [@fabianh](https://discourse.nixos.org/u/fabianh)
#### Post date: [August 19, 2024, 4:38pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/2 "2024-08-19T16:38:31Z")

</div>

Also having issues but get

`error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused`

Attempted to reinstall both with official installer and determinatesystems installer and both break after a reboot.

---

<div class="post-metadata">

### Author: ![fabianh](https://discourse.nixos.org/user_avatar/discourse.nixos.org/fabianh/32/3280_2.png) [@fabianh](https://discourse.nixos.org/u/fabianh)
#### Post date: [August 19, 2024, 4:43pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/3 "2024-08-19T16:43:05Z")

</div>

> [@badger](#):
>
> ```auto
> sudo launchctl bootstrap system /Library/LaunchDaemons/org.nixos.nix-daemon.plist
> sudo launchctl kickstart -k system/org.nixos.darwin-store
> sudo launchctl kickstart -k system/org.nixos.nix-daemon
> 
> ```

Workaround also helped me, thanks for posting it.

---

<div class="post-metadata">

### Author: ![lilyball](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lilyball/32/939_2.png) [@lilyball](https://discourse.nixos.org/u/lilyball)
#### Post date: [August 20, 2024, 12:21am UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/4 "2024-08-20T00:21:44Z")

</div>

What do you see with `launchctl print-disabled system`? Any chance `org.nixos.nix-daemon` is in that list? I would have expected that bootstrapping a disabled service would re-enable it (or alternatively would tell you it’s disabled), but I haven’t done any testing around that.

If the service is disabled, you can use `launchctl enable system/org.nixos.nix-daemon`. Heck, try running that even if it’s not showing up as disabled.

---

<div class="post-metadata">

### Author: ![badger](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@badger](https://discourse.nixos.org/u/badger)
#### Post date: [August 20, 2024, 2:14pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/5 "2024-08-20T14:14:23Z")

</div>

> What do you see with `launchctl print-disabled system` ?

```auto
disabled services = {
        "org.nixos.darwin-store" => enabled
        "org.nixos.nix-daemon" => enabled
}

```

And this doesn’t change with the two `launchctl enable` commands. But the services do not appear in `launchctl list` after a reboot. In fact, if I just `sudo launchctl load` the two `/Library/LaunchDaemons` paths after a reboot, then everything is working again just from that.

Any further ideas? Thanks for the suggestions so far!

---

<div class="post-metadata">

### Author: ![lilyball](https://discourse.nixos.org/user_avatar/discourse.nixos.org/lilyball/32/939_2.png) [@lilyball](https://discourse.nixos.org/u/lilyball)
#### Post date: [August 20, 2024, 11:36pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/6 "2024-08-20T23:36:10Z")

</div>

> [@badger](#):
>
> But the services do not appear in `launchctl list` after a reboot.

Note that `launchctl list` shows your user services, you need `sudo launchctl list` to show system services, which is why `launchctl print system` is the preferred command.

Assuming `launchctl print system` after reboot continues to not show them, my next suggestion is to check the permissions on the files. `ls -l /Library/LaunchDaemons/org.nixos*`. They must be owned by root, and must not allow group or world writes.

---

<div class="post-metadata">

### Author: ![badger](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/b/3bc359/32.png) [@badger](https://discourse.nixos.org/u/badger)
#### Post date: [August 21, 2024, 6:37pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/7 "2024-08-21T18:37:17Z")

</div>

So I’ve fixed it, but the change in behavior from previous versions is a little weird.

I did a `launchctl print` for everything in `/Library/LaunchDaemons`, and noticed there were a bunch that were unknown after a reboot. Moreover, they missing services seemed to be correlated with disabled items under System Settings \> Login Items \> Allow in the Background.

There were two “Allow in the Background” items listed only as “sh” and “from an unidentified developer” that I had disabled ages ago, based on not knowing what they were:

 ![Screenshot 2024-08-21 at 19.33.55](https://discourse.nixos.org/uploads/default/original/3X/5/5/550b0d788d3acb673a03f1e6162a6c670ef4983a.png)

It turns out these correspond to the two nix services, and re-enabling them solved the problem. I had no idea these were system LaunchDaemons, rather than something under ~/Library. For previous versions of macOS, this apparently had no effect, but in 14.6.1, they do.

Thanks for your help in tracking this down!

---

<div class="post-metadata">

### Author: ![samuela](https://discourse.nixos.org/user_avatar/discourse.nixos.org/samuela/32/2486_2.png) [@samuela](https://discourse.nixos.org/u/samuela)
#### Post date: [October 20, 2024, 6:40pm UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/8 "2024-10-20T18:40:35Z")

</div>

It seems sketchy to have to enable launch items titled “sh” from an “unidentified developer”. Is there anything we can do to improve the UX here?

---

<div class="post-metadata">

### Author: ![anilanar](https://discourse.nixos.org/user_avatar/discourse.nixos.org/anilanar/32/11196_2.png) [@anilanar](https://discourse.nixos.org/u/anilanar)
#### Post date: [December 15, 2025, 8:44am UTC](https://discourse.nixos.org/t/macos-upgrade-breakage/50691/9 "2025-12-15T08:44:19Z")

</div>

```auto
        program = /bin/sh
        arguments = {
                /bin/sh
                -c
                /bin/wait4path /nix/store && exec /nix/store/0miznypgg1lm2ndagl3w7i6cfnvq901c-nix-2.28.5/bin/nix-daemon
        }

```

For a more user friendly experience, gotta generate a single executable (with /bin/sh hashbang) with a sensible name such as `nix-daemon`. The name comes from the `program` property in the daemon definition.
