1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00

launchd: Swap OtherJobEnabled->PathState for nix-daemon.

This seems to be all that is necessary to run the daemon when /nix is
mounted.
* Keep RunAtLoad=false so that the daemon executable is not found when
launchd loads the service.
* Keep RunAtLoad=true in darwin-store so that it always runs.
This commit is contained in:
John Soo 2021-12-03 16:03:49 -08:00
parent 535858952c
commit 1a2861baa6
No known key found for this signature in database
GPG key ID: D8A148F8CE4DDBC2
2 changed files with 12 additions and 12 deletions

View file

@ -13,12 +13,14 @@
<string>org.nixos.nix-daemon</string> <string>org.nixos.nix-daemon</string>
<key>KeepAlive</key> <key>KeepAlive</key>
<dict> <dict>
<key>OtherJobEnabled</key> <key>PathState</key>
<dict> <dict>
<key>org.nixos.darwin-store</key> <key>/nix/var/nix/profiles/default/bin/nix-daemon</key>
<false/> <true/>
</dict> </dict>
</dict> </dict>
<key>RunAtLoad</key>
<false/>
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>/nix/var/nix/profiles/default/bin/nix-daemon</string> <string>/nix/var/nix/profiles/default/bin/nix-daemon</string>

View file

@ -303,16 +303,8 @@ generate_mount_daemon() {
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>LaunchOnlyOnce</key> <key>RunAtLoad</key>
<true/> <true/>
<key>KeepAlive</key>
<dict>
<key>PathState</key>
<dict>
<key>$NIX_ROOT/store</key>
<false/>
</dict>
</dict>
<key>Label</key> <key>Label</key>
<string>org.nixos.darwin-store</string> <string>org.nixos.darwin-store</string>
<key>ProgramArguments</key> <key>ProgramArguments</key>
@ -812,6 +804,12 @@ EOF
# TODO: should probably alert the user if this is disabled? # TODO: should probably alert the user if this is disabled?
_sudo "to launch the Nix volume mounter" \ _sudo "to launch the Nix volume mounter" \
launchctl bootstrap system "$NIX_VOLUME_MOUNTD_DEST" || true launchctl bootstrap system "$NIX_VOLUME_MOUNTD_DEST" || true
# TODO: confirm whether kickstart is necessesary?
# I feel a little superstitous, but it can guard
# against multiple problems (doesn't start, old
# version still running for some reason...)
_sudo "to launch the Nix volume mounter" \
launchctl kickstart -k system/org.nixos.darwin-store
fi fi
} }