mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
dev: add custom type rawLua
This commit is contained in:
parent
0e802c03ef
commit
47acf325d6
2 changed files with 13 additions and 1 deletions
|
@ -4,6 +4,6 @@
|
||||||
typesLanguage = import ./languages.nix {inherit lib;};
|
typesLanguage = import ./languages.nix {inherit lib;};
|
||||||
in {
|
in {
|
||||||
inherit (typesDag) dagOf;
|
inherit (typesDag) dagOf;
|
||||||
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption;
|
inherit (typesPlugin) pluginsOpt extraPluginType mkPluginSetupOption rawLua;
|
||||||
inherit (typesLanguage) diagnostics mkGrammarOption;
|
inherit (typesLanguage) diagnostics mkGrammarOption;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,6 +145,18 @@ in {
|
||||||
type = pluginsType;
|
type = pluginsType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rawLua = lib.mkOptionType {
|
||||||
|
name = "rawLua";
|
||||||
|
check = val: isString val || val ? __raw;
|
||||||
|
merge = loc: defs: let
|
||||||
|
val =
|
||||||
|
if isString loc
|
||||||
|
then {__raw = val;}
|
||||||
|
else loc;
|
||||||
|
in
|
||||||
|
lib.mergeOneOption val defs;
|
||||||
|
};
|
||||||
|
|
||||||
# opts is a attrset of options, example:
|
# opts is a attrset of options, example:
|
||||||
# ```
|
# ```
|
||||||
# mkPluginSetupOption "telescope" {
|
# mkPluginSetupOption "telescope" {
|
||||||
|
|
Loading…
Reference in a new issue