nix-darwin
nix-darwin copied to clipboard
Dock items are lost on every reboot
On every reboot, dock items are lost and I return to an empty dock.
My nix-darwin config is simple, but I can't pinpoint the issue.
Please help!
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.
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.
defaults delete com.apple.dockkillall Dock-> The original fixed items from when Mac is first set up come back.- Restart system -> Those fixed items are still persisted.
darwin-rebuild switch --flake ~/.config/nix-darwin- Remove all of Apple's default fixed items from the Dock and re-add my apps.
- Restart system -> My fixed items are persisted as expected.
darwin-rebuild switch --flake ~/.config/nix-darwin(had to remove/etc/bashrcand/etc/zshrcfor some reason, ig it cant figure itself out)- Restart system -> My fixed items are still persisted.
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.
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?
Yup, changes are still persisting through reboots for me now.