lib/options: add mkNullOrLua' variant

This commit is contained in:
Matt Sturgeon 2024-05-31 19:16:50 +01:00
parent 3a151bbf09
commit 207bfc6e69
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -32,14 +32,16 @@ rec {
mkNullOrStr' = args: mkNullOrOption' (args // { type = with nixvimTypes; maybeRaw str; }); mkNullOrStr' = args: mkNullOrOption' (args // { type = with nixvimTypes; maybeRaw str; });
mkNullOrStr = description: mkNullOrStr' { inherit description; }; mkNullOrStr = description: mkNullOrStr' { inherit description; };
mkNullOrLua = mkNullOrLua' =
desc: args:
lib.mkOption { mkNullOrOption' (
type = lib.types.nullOr nixvimTypes.strLua; args
default = null; // {
description = desc; type = nixvimTypes.strLua;
apply = mkRaw; apply = mkRaw;
}; }
);
mkNullOrLua = description: mkNullOrLua' { inherit description; };
mkNullOrLuaFn = mkNullOrLuaFn =
desc: desc: