From 4b3d019eee28d3316f199fd87db206c82d2e00c7 Mon Sep 17 00:00:00 2001 From: traxys Date: Mon, 28 Aug 2023 13:32:08 +0200 Subject: [PATCH] lib: Use mkOptionType for `rawType` (#556) This allows the type to be rendered as `raw lua code` instead of `submodule` in the documentation. --- lib/helpers.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/helpers.nix b/lib/helpers.nix index 8edaebcf..27ef7187 100644 --- a/lib/helpers.nix +++ b/lib/helpers.nix @@ -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;