system.defaults.dock.persistent-apps doesn't work
I've tried setting persistent Dock apps via system.defaults.dock."persistent-apps" option as shown in the docs:
system.defaults.dock."persistent-apps" = [
"/Applications/Mail.app"
];
When I apply the settings, I get a question mark item in the Dock instead.
I've tried different variations of the string value ("Mail.app", file///Applications/Mail.app/ etc.) but nothing worked.
When I examined applied Dock default with defaults read com.apple.dock persistent-apps, I see the generated items look like:
{
"tile-data" = {
"file-data" = {
"_CFURLString" = "/Applications/Mail.app";
"_CFURLStringType" = 0;
};
};
},
...while a proper manually created items look like this:
{
"tile-data" = {
book = {length = 588, bytes = 0x626f6f6b 4c020000 00000410 30000000 ... 04000000 00000000 };
"bundle-identifier" = "com.apple.systempreferences";
"dock-extra" = 1;
"file-data" = {
"_CFURLString" = "file:///System/Applications/System%20Settings.app/";
"_CFURLStringType" = 15;
};
"file-label" = "System Settings";
"file-mod-date" = 0;
"file-type" = 1;
"is-beta" = 0;
"parent-mod-date" = 0;
};
"tile-type" = "file-tile";
}
Has anyone managed to get persistent apps in Dock with nix-darwin?
I'm running MacOS Sequoia 15.2.
Apparently, it works for default system applications with a path like "/System/Applications/Mail.app".
If anyone can't get Safari to appear more than a question mark, Safari is /System/Cryptexes/App/System/Applications/Safari.app
Experiencing the same in Sequoia 15.6. I'm guessing it might be that Sequoia stores dock metadata differently. It's particularly annoying because I can't seem to disable dock management, which means each time I apply my config or reboot the system it will empty my dock and I can't persistently override this.