nixos/emacs: make systemd report clean exit status when stopping (#397916)

This commit is contained in:
Weijia Wang
2025-04-23 15:06:56 +02:00
committed by GitHub

View File

@@ -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";
};