mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 20:13:18 +00:00
f3be3cda6a
* services/emacs: add `defaultEditor` option Sets `emacsclient` as the default editor using the `EDITOR` environment variable.
24 lines
508 B
Nix
24 lines
508 B
Nix
{ 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;
|
|
}
|
|
}";
|
|
}
|