On Darwin, launchd may attempt to start agents before the Nix store is mounted and available. This leads to failures when the agent's executable or arguments reside in the Nix store. This change wraps the agent's command in a shell script that uses /bin/wait4path to ensure /nix/store is ready before executing the original program. It also ensures that ProgramArguments are correctly escaped and concatenated.
23 lines
No EOL
605 B
Text
23 lines
No EOL
605 B
Text
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>KeepAlive</key>
|
|
<dict>
|
|
<key>Crashed</key>
|
|
<true/>
|
|
<key>SuccessfulExit</key>
|
|
<false/>
|
|
</dict>
|
|
<key>Label</key>
|
|
<string>org.nix-community.home.syncthing</string>
|
|
<key>ProcessType</key>
|
|
<string>Background</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>/bin/sh</string>
|
|
<string>-c</string>
|
|
<string>/bin/wait4path /nix/store && exec @syncthing-wrapper@</string>
|
|
</array>
|
|
</dict>
|
|
</plist> |