emacs: Remove obsolete socket file workaround
This commit is contained in:
parent
54586daa59
commit
47226ec7e7
|
@ -12,6 +12,10 @@ let
|
||||||
clientWMClass =
|
clientWMClass =
|
||||||
if versionAtLeast emacsVersion "28" then "Emacsd" else "Emacs";
|
if versionAtLeast emacsVersion "28" then "Emacsd" else "Emacs";
|
||||||
|
|
||||||
|
# Workaround for https://debbugs.gnu.org/47511
|
||||||
|
needsSocketWorkaround = versionOlder emacsVersion "28"
|
||||||
|
&& cfg.socketActivation.enable;
|
||||||
|
|
||||||
# Adapted from upstream emacs.desktop
|
# Adapted from upstream emacs.desktop
|
||||||
clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop"
|
clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop"
|
||||||
(generators.toINI { } {
|
(generators.toINI { } {
|
||||||
|
@ -128,7 +132,7 @@ in {
|
||||||
# Avoid killing the Emacs session, which may be full of
|
# Avoid killing the Emacs session, which may be full of
|
||||||
# unsaved buffers.
|
# unsaved buffers.
|
||||||
X-RestartIfChanged = false;
|
X-RestartIfChanged = false;
|
||||||
} // optionalAttrs (cfg.socketActivation.enable) {
|
} // optionalAttrs needsSocketWorkaround {
|
||||||
# Emacs deletes its socket when shutting down, which systemd doesn't
|
# Emacs deletes its socket when shutting down, which systemd doesn't
|
||||||
# handle, resulting in a server without a socket.
|
# handle, resulting in a server without a socket.
|
||||||
# See https://github.com/nix-community/home-manager/issues/2018
|
# See https://github.com/nix-community/home-manager/issues/2018
|
||||||
|
@ -157,7 +161,7 @@ in {
|
||||||
SuccessExitStatus = 15;
|
SuccessExitStatus = 15;
|
||||||
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
} // optionalAttrs (cfg.socketActivation.enable) {
|
} // optionalAttrs needsSocketWorkaround {
|
||||||
# Use read-only directory permissions to prevent emacs from
|
# Use read-only directory permissions to prevent emacs from
|
||||||
# deleting systemd's socket file before exiting.
|
# deleting systemd's socket file before exiting.
|
||||||
ExecStartPost =
|
ExecStartPost =
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
${
|
${
|
||||||
pkgs.substituteAll {
|
pkgs.substituteAll {
|
||||||
inherit (pkgs) runtimeShell coreutils;
|
inherit (pkgs) runtimeShell coreutils;
|
||||||
src = ./emacs-socket-emacs.service;
|
src = ./emacs-socket-27-emacs.service;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
tests/modules/services/emacs/emacs-socket-28-emacs.service
Normal file
10
tests/modules/services/emacs/emacs-socket-28-emacs.service
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[Service]
|
||||||
|
ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon='%t/emacs/server' '-f' 'exwm-enable'"
|
||||||
|
Restart=on-failure
|
||||||
|
SuccessExitStatus=15
|
||||||
|
Type=notify
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Emacs text editor
|
||||||
|
Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
|
||||||
|
X-RestartIfChanged=false
|
|
@ -32,7 +32,7 @@
|
||||||
${
|
${
|
||||||
pkgs.substituteAll {
|
pkgs.substituteAll {
|
||||||
inherit (pkgs) runtimeShell coreutils;
|
inherit (pkgs) runtimeShell coreutils;
|
||||||
src = ./emacs-socket-emacs.service;
|
src = ./emacs-socket-28-emacs.service;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue