diff --git a/modules/nvim-lazy/default.nix b/modules/nvim-lazy/default.nix index 24169cf..4b2735c 100644 --- a/modules/nvim-lazy/default.nix +++ b/modules/nvim-lazy/default.nix @@ -2,7 +2,34 @@ let mkOption = lib.mkOption; types = lib.types; - plugin = types.submodule ( + keyBind = ( + { ... }: + { + options = { + bind = mkOption { + type = types.str; + default = ""; + description = ''The keys to bind.''; + }; + cmd = mkOption { + type = with types; nullOr str; + default = null; + description = ''The command to execute. If this is a lua function set cmdIsFunction to true.''; + }; + cmdIsFunction = mkOption { + type = types.bool; + default = false; + description = ''Needs to be set to true if cmd is a lua function.''; + }; + opts = mkOption { + type = with types; nullOr attrs; + default = null; + description = ''Additional named parameters passed to the keybind function.''; + }; + }; + } + ); + plugin = ( { ... }: { options = { @@ -150,7 +177,7 @@ let }; keys = mkOption { # TODO: update; - type = with types; nullOr (listOf attrs); + type = with types; nullOr (listOf (submodule keyBind)); default = null; description = ''Lazy-load on key mapping.''; }; @@ -195,7 +222,7 @@ in with types; listOf (oneOf [ str - plugin + (submodule plugin) ]); default = [ ]; description = ''List of plugins to be installed with neovim.'';