lib/keymap-helpers: refactor mkMapOptionSubmodule

Make the `key` and `action` options optional, and allow configuring
whether `action` can be a raw type.
This commit is contained in:
Matt Sturgeon 2024-06-01 16:17:23 +01:00
parent 87d6654a9f
commit df3aa86713
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 53 additions and 35 deletions

View file

@ -36,7 +36,14 @@ in
keymaps = mapAttrs (
action: defaults:
helpers.mkNullOrOption (
with types; either str (helpers.keymaps.mkMapOptionSubmodule defaults)
with types;
either str (
helpers.keymaps.mkMapOptionSubmodule {
inherit defaults;
hasKey = true;
hasAction = true;
}
)
) "Keymap for the ${action} action."
) defaultKeymaps;