From 69b3a1353278cc928303d552d0e2487abc555fa8 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 16 Oct 2023 11:03:28 +0200 Subject: [PATCH] modules/keymaps: `keymaps` option should not accept str mappings --- lib/keymap-helpers.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/keymap-helpers.nix b/lib/keymap-helpers.nix index 34dd1769..e1e5f2ca 100644 --- a/lib/keymap-helpers.nix +++ b/lib/keymap-helpers.nix @@ -84,10 +84,8 @@ in rec { withKeyOpt ? true, flatConfig ? false, }: - with types; - either - str - (submodule { + with types; let + mapOptionSubmodule = submodule { options = ( if withKeyOpt @@ -133,7 +131,11 @@ in rec { options = mapConfigOptions; } ); - }); + }; + in + if flatConfig + then either str mapOptionSubmodule + else mapOptionSubmodule; # Correctly merge two attrs (partially) representing a mapping. mergeKeymap = defaults: keymap: let