mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-10 19:11:06 +01:00
services/emacs: add option to set emacsclient as the default editor (#2545)
* services/emacs: add `defaultEditor` option Sets `emacsclient` as the default editor using the `EDITOR` environment variable.
This commit is contained in:
parent
05d655146b
commit
f3be3cda6a
4 changed files with 63 additions and 1 deletions
24
tests/modules/services/emacs/emacs-default-editor.nix
Normal file
24
tests/modules/services/emacs/emacs-default-editor.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
# Use `cat` instead of `echo` to prevent arguments from being
|
||||
# interpreted as an option.
|
||||
emacs = pkgs.writeShellScriptBin "emacsclient"
|
||||
''${pkgs.coreutils}/bin/cat <<< "$*"'';
|
||||
})
|
||||
];
|
||||
|
||||
services.emacs = {
|
||||
defaultEditor = true;
|
||||
enable = true;
|
||||
};
|
||||
|
||||
nmt.script = "source ${
|
||||
pkgs.substituteAll {
|
||||
inherit (pkgs) coreutils;
|
||||
src = ./emacs-default-editor.sh;
|
||||
}
|
||||
}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue