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.
25 lines
No EOL
772 B
Text
25 lines
No EOL
772 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.opencode-web</string>
|
|
<key>ProcessType</key>
|
|
<string>Background</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>/bin/sh</string>
|
|
<string>-c</string>
|
|
<string>/bin/wait4path /nix/store && exec @opencode@/bin/opencode web --hostname 0.0.0.0 --port 4096 --mdns --cors https://example.com --cors http://localhost:3000 --print-logs --log-level DEBUG</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
</dict>
|
|
</plist> |