options: add defaultNullOpts.mkRaw

This commit is contained in:
Gaetan Lepage 2024-11-13 23:10:38 +01:00
parent f11a877bcc
commit ccae4350d0
2 changed files with 14 additions and 1 deletions

View file

@ -147,6 +147,19 @@ rec {
mkLuaFn' = args: mkNullOrLuaFn' (processDefaultNullArgs args);
mkLuaFn = pluginDefault: description: mkLuaFn' { inherit pluginDefault description; };
mkRaw' =
args:
mkNullable' (
args
// {
type = types.rawLua;
}
// lib.optionalAttrs (args ? pluginDefault) {
pluginDefault = lib.nixvim.mkRaw args.pluginDefault;
}
);
mkRaw = pluginDefault: description: mkRaw' { inherit pluginDefault description; };
mkNum' = args: mkNullableWithRaw' (args // { type = types.number; });
mkNum = pluginDefault: description: mkNum' { inherit pluginDefault description; };
mkInt' = args: mkNullableWithRaw' (args // { type = types.int; });

View file

@ -140,7 +140,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
Keys to use to dismiss the popup.
'';
override_function = defaultNullOpts.mkNullable types.rawLua { __raw = "function(_) end"; } ''
override_function = defaultNullOpts.mkRaw "function(_) end" ''
Override function to map keys to actions.
```lua