diff --git a/modules/services/emacs.nix b/modules/services/emacs.nix index e280b3219..74b3b9042 100644 --- a/modules/services/emacs.nix +++ b/modules/services/emacs.nix @@ -221,8 +221,10 @@ in { launchd.agents.emacs = { enable = true; config = { - ProgramArguments = [ "${cfg.package}/bin/emacs" "--fg-daemon" ] + ProgramArguments = [ "${emacsBinPath}/emacs" "--fg-daemon" ] ++ cfg.extraOptions; + EnvironmentVariables.PATH = + "${config.home.profileDirectory}/bin:/usr/bin:/bin:/usr/sbin:/sbin"; RunAtLoad = true; KeepAlive = { Crashed = true; diff --git a/tests/modules/services/emacs-darwin/expected-agent.plist b/tests/modules/services/emacs-darwin/expected-agent.plist index 819457582..bb44b8767 100644 --- a/tests/modules/services/emacs-darwin/expected-agent.plist +++ b/tests/modules/services/emacs-darwin/expected-agent.plist @@ -3,6 +3,10 @@ KeepAlive + + PATH + /home/hm-user/.nix-profile/bin:/usr/bin:/bin:/usr/sbin:/sbin + Crashed