mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 01:38:40 +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
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
rawType = types.submodule {
|
rawType = mkOptionType {
|
||||||
options = {
|
name = "rawType";
|
||||||
__raw = mkOption {
|
description = "raw lua code";
|
||||||
type = types.str;
|
descriptionClass = "noun";
|
||||||
description = "raw lua code";
|
merge = mergeEqualOption;
|
||||||
default = "";
|
check = isRawType;
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
isRawType = v: lib.isAttrs v && lib.hasAttr "__raw" v && lib.isString v.__raw;
|
isRawType = v: lib.isAttrs v && lib.hasAttr "__raw" v && lib.isString v.__raw;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue