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; });