mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
services.emacs: add option extraOptions
This is to allow adding command-line arguments to the Emacs daemon. Previously only the Emacs client could be started with custom arguments.
This commit is contained in:
parent
d5151186ac
commit
0f3dfc94ef
7 changed files with 16 additions and 3 deletions
|
@ -54,6 +54,15 @@ in {
|
||||||
description = "The Emacs package to use.";
|
description = "The Emacs package to use.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
default = [ ];
|
||||||
|
example = [ "-f" "exwm-enable" ];
|
||||||
|
description = ''
|
||||||
|
Extra command-line arguments to pass to <command>emacs</command>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
client = {
|
client = {
|
||||||
enable = mkEnableOption "generation of Emacs client desktop file";
|
enable = mkEnableOption "generation of Emacs client desktop file";
|
||||||
arguments = mkOption {
|
arguments = mkOption {
|
||||||
|
@ -111,7 +120,7 @@ in {
|
||||||
# when using socket activation.
|
# when using socket activation.
|
||||||
optionalString cfg.socketActivation.enable
|
optionalString cfg.socketActivation.enable
|
||||||
"=${escapeShellArg socketPath}"
|
"=${escapeShellArg socketPath}"
|
||||||
}"'';
|
} ${escapeShellArgs cfg.extraOptions}"'';
|
||||||
|
|
||||||
# Emacs will exit with status 15 after having received SIGTERM, which
|
# Emacs will exit with status 15 after having received SIGTERM, which
|
||||||
# is the default "KillSignal" value systemd uses to stop services.
|
# is the default "KillSignal" value systemd uses to stop services.
|
||||||
|
|
|
@ -17,6 +17,7 @@ with lib;
|
||||||
programs.emacs.enable = true;
|
programs.emacs.enable = true;
|
||||||
services.emacs.enable = true;
|
services.emacs.enable = true;
|
||||||
services.emacs.client.enable = true;
|
services.emacs.client.enable = true;
|
||||||
|
services.emacs.extraOptions = [ "-f" "exwm-enable" ];
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertPathNotExists home-files/.config/systemd/user/emacs.socket
|
assertPathNotExists home-files/.config/systemd/user/emacs.socket
|
||||||
|
|
|
@ -17,6 +17,7 @@ with lib;
|
||||||
programs.emacs.enable = true;
|
programs.emacs.enable = true;
|
||||||
services.emacs.enable = true;
|
services.emacs.enable = true;
|
||||||
services.emacs.client.enable = true;
|
services.emacs.client.enable = true;
|
||||||
|
services.emacs.extraOptions = [ "-f" "exwm-enable" ];
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertPathNotExists home-files/.config/systemd/user/emacs.socket
|
assertPathNotExists home-files/.config/systemd/user/emacs.socket
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon"
|
ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon '-f' 'exwm-enable'"
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
SuccessExitStatus=15
|
SuccessExitStatus=15
|
||||||
Type=notify
|
Type=notify
|
||||||
|
|
|
@ -19,6 +19,7 @@ in {
|
||||||
programs.emacs.enable = true;
|
programs.emacs.enable = true;
|
||||||
services.emacs.enable = true;
|
services.emacs.enable = true;
|
||||||
services.emacs.client.enable = true;
|
services.emacs.client.enable = true;
|
||||||
|
services.emacs.extraOptions = [ "-f" "exwm-enable" ];
|
||||||
services.emacs.socketActivation.enable = true;
|
services.emacs.socketActivation.enable = true;
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
|
|
|
@ -19,6 +19,7 @@ in {
|
||||||
programs.emacs.enable = true;
|
programs.emacs.enable = true;
|
||||||
services.emacs.enable = true;
|
services.emacs.enable = true;
|
||||||
services.emacs.client.enable = true;
|
services.emacs.client.enable = true;
|
||||||
|
services.emacs.extraOptions = [ "-f" "exwm-enable" ];
|
||||||
services.emacs.socketActivation.enable = true;
|
services.emacs.socketActivation.enable = true;
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon='%t/emacs/server'"
|
ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon='%t/emacs/server' '-f' 'exwm-enable'"
|
||||||
ExecStartPost=@coreutils@/bin/chmod --changes -w %t/emacs
|
ExecStartPost=@coreutils@/bin/chmod --changes -w %t/emacs
|
||||||
ExecStopPost=@coreutils@/bin/chmod --changes +w %t/emacs
|
ExecStopPost=@coreutils@/bin/chmod --changes +w %t/emacs
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
Loading…
Reference in a new issue