summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2024-06-02 14:42:35 +0800
committerGitHub <noreply@github.com>2024-06-02 14:42:35 +0800
commit0dd47a00b79dae28e099ce9dbfa8a637795badef (patch)
tree85cf7af8866d649acc2accddb68dee406f029162 /nixos
parent5f0b88ca430f18701424c50a4ccbff8fc7e186ba (diff)
parenteacb151e5d71c2776b8d4eed64ba8d3bb6a0d2f5 (diff)
Merge pull request #316500 from acid-bong/emacs
nixos/emacs: simplify the service's ExecStart line
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/editors/emacs.nix7
1 files changed, 3 insertions, 4 deletions
diff --git a/nixos/modules/services/editors/emacs.nix b/nixos/modules/services/editors/emacs.nix
index 35f257cee1e3..98d8506e6727 100644
--- a/nixos/modules/services/editors/emacs.nix
+++ b/nixos/modules/services/editors/emacs.nix
@@ -6,8 +6,7 @@ let
cfg = config.services.emacs;
- editorScript = pkgs.writeScriptBin "emacseditor" ''
- #!${pkgs.runtimeShell}
+ editorScript = pkgs.writeShellScriptBin "emacseditor" ''
if [ -z "$1" ]; then
exec ${cfg.package}/bin/emacsclient --create-frame --alternate-editor ${cfg.package}/bin/emacs
else
@@ -70,8 +69,8 @@ in
description = "Emacs: the extensible, self-documenting text editor";
serviceConfig = {
- Type = "forking";
- ExecStart = "${pkgs.bash}/bin/bash -c 'source ${config.system.build.setEnvironment}; exec ${cfg.package}/bin/emacs --daemon'";
+ 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)";
Restart = "always";
};