diff --git a/nixos/modules/services/editors/emacs.nix b/nixos/modules/services/editors/emacs.nix index 50bca3596032..65211763e5a2 100644 --- a/nixos/modules/services/editors/emacs.nix +++ b/nixos/modules/services/editors/emacs.nix @@ -73,7 +73,8 @@ in serviceConfig = { Type = "notify"; ExecStart = "${pkgs.runtimeShell} -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --fg-daemon'"; - ExecStop = "${cfg.package}/bin/emacsclient --eval (kill-emacs)"; + # Emacs exits with exit code 15 (SIGTERM), when stopped by systemd. + SuccessExitStatus = 15; Restart = "always"; };