-
-
Notifications
You must be signed in to change notification settings - Fork 598
Description
Description
On macOS, the System Settings → General → Login Items & Extensions panel displays LaunchDaemons by their executable name. Because nix-darwin's core services use /bin/sh -c "..." to wait for the Nix store before executing, they all appear as generic "sh" entries labeled "Item from unidentified developer."
This makes it difficult for users to identify what these services are, especially when multiple "sh" entries appear with no distinguishing information.
Current Behavior
The following services all show as "sh" in Login Items:
org.nixos.nix-daemonorg.nixos.darwin-storeorg.nixos.activate-systemorg.nixos.nix-optimise
Example plist (nix-daemon):
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>/bin/wait4path /nix/store && exec /nix/store/.../bin/nix-daemon</string>
</array>Expected Behavior
Services should appear with descriptive names like "nix-daemon", "darwin-store", etc., so users can easily identify them in macOS System Settings.
Proposed Solution
Create named wrapper scripts in the Nix store that handle the wait4path logic, then reference those scripts in ProgramArguments:
# Wrapper script derivation
nix-daemon-wrapper = pkgs.writeScriptBin "nix-daemon-start" '
#!/bin/sh
/bin/wait4path /nix/store && exec ${config.nix.package}/bin/nix-daemon
';
# In the launchd plist
ProgramArguments = [ "${nix-daemon-wrapper}/bin/nix-daemon-start" ];This would make macOS display "nix-daemon-start" (or similar) instead of "sh".
Environment
- macOS: 26.2 (Tahoe)
- nix-darwin:
9f48ffaca1f44b3e590976b4da8666a9e86e6eb1 - Nix: 2.29.0
Additional Context
The same issue affects the Determinate Systems installer's systems.determinate.nix-installer.nix-hook service, which would need a similar fix upstream in that project.