diff --git a/modules/services/nix-daemon.nix b/modules/services/nix-daemon.nix index ce9c1894..42d31c94 100644 --- a/modules/services/nix-daemon.nix +++ b/modules/services/nix-daemon.nix @@ -44,7 +44,10 @@ in nix.useDaemon = true; launchd.daemons.nix-daemon = { - command = "${config.nix.package}/bin/nix-daemon"; + serviceConfig.ProgramArguments = [ + "/bin/sh" "-c" + "/bin/wait4path ${config.nix.package}/bin/nix-daemon && exec ${config.nix.package}/bin/nix-daemon" + ]; serviceConfig.ProcessType = config.nix.daemonProcessType; serviceConfig.LowPriorityIO = config.nix.daemonIOLowPriority; serviceConfig.Label = "org.nixos.nix-daemon"; # must match daemon installed by Nix regardless of the launchd label Prefix