mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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; };
|
||||
|
||||
mkNullOrStrLuaOr =
|
||||
ty: desc:
|
||||
lib.mkOption {
|
||||
type = lib.types.nullOr (types.either nixvimTypes.strLua ty);
|
||||
default = null;
|
||||
description = desc;
|
||||
apply = v: if builtins.isString v then mkRaw v else v;
|
||||
};
|
||||
mkNullOrStrLuaOr' =
|
||||
{ type, ... }@args:
|
||||
mkNullOrOption' (
|
||||
args
|
||||
// {
|
||||
type = with nixvimTypes; either strLua type;
|
||||
apply = v: if isString v then mkRaw v else v;
|
||||
}
|
||||
);
|
||||
mkNullOrStrLuaOr = type: description: mkNullOrStrLuaOr' { inherit type description; };
|
||||
|
||||
mkNullOrStrLuaFnOr =
|
||||
ty: desc:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue