conditional default editor config

This commit is contained in:
Grigory Shipunov 2023-05-01 07:50:13 +02:00
parent 60d3e01199
commit 6048c1f7ad
Signed by: 0xa
GPG key ID: 91FA5E5BF9AA901C
2 changed files with 17 additions and 7 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, config, ... }:
{ {
imports = [ imports = [
@ -36,11 +36,20 @@
ouch ouch
]; ];
environment.variables = { environment.variables =
EDITOR = "nvim"; let
PAGER = "less"; editorconf =
LESS = "-X -R -F"; if config.services.emacs.defaultEditor then
}; { }
else
{
EDITOR = "nvim";
};
in
{
PAGER = "less";
LESS = "-X -R -F";
} // editorconf;
environment.shellAliases = { environment.shellAliases = {
ls = "ls --color=auto"; ls = "ls --color=auto";

View file

@ -14,8 +14,9 @@
enable = false; enable = false;
package = with pkgs; ((emacsPackagesFor emacsPgtk).emacsWithPackages (epkgs: with epkgs; [ package = with pkgs; ((emacsPackagesFor emacsPgtk).emacsWithPackages (epkgs: with epkgs; [
vterm vterm
pdf-tools
])); ]));
defaultEditor = false; defaultEditor = true;
}; };
} }