mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
lib/options: add mkNullOrStrLuaOr'
variant
This commit is contained in:
parent
56ee982cb4
commit
5bcb6184b0
1 changed files with 10 additions and 8 deletions
|
@ -54,14 +54,16 @@ rec {
|
||||||
);
|
);
|
||||||
mkNullOrLuaFn = description: mkNullOrLua' { inherit description; };
|
mkNullOrLuaFn = description: mkNullOrLua' { inherit description; };
|
||||||
|
|
||||||
mkNullOrStrLuaOr =
|
mkNullOrStrLuaOr' =
|
||||||
ty: desc:
|
{ type, ... }@args:
|
||||||
lib.mkOption {
|
mkNullOrOption' (
|
||||||
type = lib.types.nullOr (types.either nixvimTypes.strLua ty);
|
args
|
||||||
default = null;
|
// {
|
||||||
description = desc;
|
type = with nixvimTypes; either strLua type;
|
||||||
apply = v: if builtins.isString v then mkRaw v else v;
|
apply = v: if isString v then mkRaw v else v;
|
||||||
};
|
}
|
||||||
|
);
|
||||||
|
mkNullOrStrLuaOr = type: description: mkNullOrStrLuaOr' { inherit type description; };
|
||||||
|
|
||||||
mkNullOrStrLuaFnOr =
|
mkNullOrStrLuaFnOr =
|
||||||
ty: desc:
|
ty: desc:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue