mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 09:48:42 +02:00
helpers: move rawType to helpers.nixvimTypes (#871)
This is done in preparation of adding new (lua) types to help the documentation.
This commit is contained in:
parent
2f13e3a21d
commit
af41ea2d80
38 changed files with 80 additions and 75 deletions
|
@ -141,7 +141,7 @@ with lib; rec {
|
|||
);
|
||||
|
||||
defaultNullOpts = let
|
||||
maybeRaw = t: lib.types.either t rawType;
|
||||
maybeRaw = t: lib.types.either t nixvimTypes.rawLua;
|
||||
in rec {
|
||||
mkNullable = type: default: desc:
|
||||
mkNullOrOption type (
|
||||
|
@ -404,13 +404,18 @@ with lib; rec {
|
|||
end
|
||||
'';
|
||||
|
||||
rawType = mkOptionType {
|
||||
name = "rawType";
|
||||
description = "raw lua code";
|
||||
descriptionClass = "noun";
|
||||
merge = mergeEqualOption;
|
||||
check = isRawType;
|
||||
};
|
||||
nixvimTypes =
|
||||
{
|
||||
rawLua = mkOptionType {
|
||||
name = "rawType";
|
||||
description = "raw lua code";
|
||||
descriptionClass = "noun";
|
||||
merge = mergeEqualOption;
|
||||
check = isRawType;
|
||||
};
|
||||
}
|
||||
# Allow to do `with nixvimTypes;` instead of `with types;`
|
||||
// types;
|
||||
|
||||
isRawType = v: lib.isAttrs v && lib.hasAttr "__raw" v && lib.isString v.__raw;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue