From 16946a6f008afa13911805418217dbd92f1fedde Mon Sep 17 00:00:00 2001 From: Olli Helenius Date: Sun, 23 Dec 2018 12:53:01 +0200 Subject: [PATCH] Address review comments --- modules/programs/zsh.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index f46b6f66..b710f953 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -193,10 +193,10 @@ in }; defaultKeymap = mkOption { - type = types.nullOr (types.enum [ "emacs" "viins" "vicmd" ]); + type = types.nullOr (types.enum (attrNames bindkeyCommands)); default = null; example = "emacs"; - description = "The default base keymap to use"; + description = "The default base keymap to use."; }; sessionVariables = mkOption { @@ -316,8 +316,10 @@ in HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help" - ${if cfg.defaultKeymap != null && hasAttr cfg.defaultKeymap bindkeyCommands - then getAttr cfg.defaultKeymap bindkeyCommands else ""} + ${optionalString (cfg.defaultKeymap != null) '' + # Use ${cfg.defaultKeymap} keymap as the default. + ${getAttr cfg.defaultKeymap bindkeyCommands} + ''} ${concatStrings (map (plugin: '' path+="$HOME/${pluginsDir}/${plugin.name}"