mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
lib: Use mkOptionType for rawType
(#556)
This allows the type to be rendered as `raw lua code` instead of `submodule` in the documentation.
This commit is contained in:
parent
1d48986c41
commit
4b3d019eee
1 changed files with 6 additions and 8 deletions
|
@ -318,14 +318,12 @@ with lib; rec {
|
|||
end
|
||||
'';
|
||||
|
||||
rawType = types.submodule {
|
||||
options = {
|
||||
__raw = mkOption {
|
||||
type = types.str;
|
||||
description = "raw lua code";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
rawType = mkOptionType {
|
||||
name = "rawType";
|
||||
description = "raw lua code";
|
||||
descriptionClass = "noun";
|
||||
merge = mergeEqualOption;
|
||||
check = isRawType;
|
||||
};
|
||||
|
||||
isRawType = v: lib.isAttrs v && lib.hasAttr "__raw" v && lib.isString v.__raw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue