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