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:
traxys 2023-08-28 13:32:08 +02:00 committed by GitHub
parent 1d48986c41
commit 4b3d019eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;