LnL7 / nix-darwin

nix modules for darwin
MIT License
3.17k stars 456 forks source link

Dock items are lost on every reboot #789

Open V4G4X opened 1 year ago

V4G4X commented 1 year ago

On every reboot, dock items are lost and I return to an empty dock.
image

My nix-darwin config is simple, but I can't pinpoint the issue.

Please help!

Ovyerus commented 11 months ago

This is happening to me too. My config is a bit more complex, but this has been occurring since I first started using nix-darwin. MacOS 14.1.2.

Ovyerus commented 11 months ago

Did some more in-depth testing with a friend (@spotlightishere) and we figured this much out. They weren't able to reproduce this with either mine or @V4G4X's config weirdly. Running defaults read com.apple.dock shows that persistent-apps and persistent-other are filled out as expected when setting apps to stay in dock, but for whatever reason they aren't getting applied after a reboot.

I decided to do these steps as some further testing and this actually fixed it for me somehow.

My guess as to the cause of this is some sort of obscure corruption occurring to persistent-apps and persistent-other somehow, but I have no clue.

V4G4X commented 11 months ago

What I had discovered is that after running darwin-rebuild the dock file: ~/Library/Preferences/com.apple.dock.plist is modified(empty) and becomes read-only for some reason.

And as such after every reboot, the empty version is loaded from disk.

What I straight up did is just kept a copy of a functional dock.plist file. I rarely reboot, so when I do I just cp it back into place.

Though I am curious @Ovyerus, after your list of steps did your dock work normally permanently?

Like you can add/remove items from the dock and on the next reboot those changes persist?

Ovyerus commented 11 months ago

Yup, changes are still persisting through reboots for me now.