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 = description: mkNullOrStr' { inherit description; };
mkNullOrLua =
desc:
lib.mkOption {
type = lib.types.nullOr nixvimTypes.strLua;
default = null;
description = desc;
apply = mkRaw;
};
mkNullOrLua' =
args:
mkNullOrOption' (
args
// {
type = nixvimTypes.strLua;
apply = mkRaw;
}
);
mkNullOrLua = description: mkNullOrLua' { inherit description; };
mkNullOrLuaFn =
desc: