nixos/emacs: make systemd report clean exit status when stopping

see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45181 for details

Changed files
+2 -1
nixos
modules
services
editors
+2 -1
nixos/modules/services/editors/emacs.nix
···
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";
};