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