From 6048c1f7ad63662112287f0807892ea78d0ec819 Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Mon, 1 May 2023 07:50:13 +0200 Subject: conditional default editor config --- modules/basic-tools/default.nix | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'modules/basic-tools/default.nix') diff --git a/modules/basic-tools/default.nix b/modules/basic-tools/default.nix index 3ed4f9f..07d14cb 100644 --- a/modules/basic-tools/default.nix +++ b/modules/basic-tools/default.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { imports = [ @@ -36,11 +36,20 @@ ouch ]; - environment.variables = { - EDITOR = "nvim"; - PAGER = "less"; - LESS = "-X -R -F"; - }; + environment.variables = + let + editorconf = + if config.services.emacs.defaultEditor then + { } + else + { + EDITOR = "nvim"; + }; + in + { + PAGER = "less"; + LESS = "-X -R -F"; + } // editorconf; environment.shellAliases = { ls = "ls --color=auto"; -- cgit v1.3.1