lib/options: add mkCompositeOption' variant

This commit is contained in:
Matt Sturgeon 2024-05-31 18:41:49 +01:00
parent fc542329cd
commit 9bf7724b98
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -22,7 +22,12 @@ rec {
); );
mkNullOrOption = type: description: mkNullOrOption' { inherit type description; }; mkNullOrOption = type: description: mkNullOrOption' { inherit type description; };
mkCompositeOption = desc: options: mkNullOrOption (types.submodule { inherit options; }) desc; mkCompositeOption' =
{ options, ... }@args:
mkNullOrOption' (
(filterAttrs (n: _: n != "options") args) // { type = types.submodule { inherit options; }; }
);
mkCompositeOption = description: options: mkCompositeOption' { inherit description options; };
mkNullOrStr = mkNullOrOption (with nixvimTypes; maybeRaw str); mkNullOrStr = mkNullOrOption (with nixvimTypes; maybeRaw str);