lib/options: remove redundant mkRaw apply functions

`strLua` now does this coercion internally.
This commit is contained in:
Matt Sturgeon 2024-09-29 15:13:49 +01:00
parent a9c08fb6a5
commit bd6aa476b8
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -90,48 +90,18 @@ rec {
mkNullOrStr' = args: mkNullOrOption' (args // { type = with types; maybeRaw str; }); mkNullOrStr' = args: mkNullOrOption' (args // { type = with types; maybeRaw str; });
mkNullOrStr = description: mkNullOrStr' { inherit description; }; mkNullOrStr = description: mkNullOrStr' { inherit description; };
mkNullOrLua' = mkNullOrLua' = args: mkNullOrOption' (args // { type = types.strLua; });
args:
mkNullOrOption' (
args
// {
type = types.strLua;
apply = lib.nixvim.mkRaw;
}
);
mkNullOrLua = description: mkNullOrLua' { inherit description; }; mkNullOrLua = description: mkNullOrLua' { inherit description; };
mkNullOrLuaFn' = mkNullOrLuaFn' = args: mkNullOrOption' (args // { type = types.strLuaFn; });
args:
mkNullOrOption' (
args
// {
type = types.strLuaFn;
apply = lib.nixvim.mkRaw;
}
);
mkNullOrLuaFn = description: mkNullOrLua' { inherit description; }; mkNullOrLuaFn = description: mkNullOrLua' { inherit description; };
mkNullOrStrLuaOr' = mkNullOrStrLuaOr' =
{ type, ... }@args: { type, ... }@args: mkNullOrOption' (args // { type = with types; either strLua type; });
mkNullOrOption' (
args
// {
type = with types; either strLua type;
apply = v: if lib.isString v then lib.nixvim.mkRaw v else v;
}
);
mkNullOrStrLuaOr = type: description: mkNullOrStrLuaOr' { inherit type description; }; mkNullOrStrLuaOr = type: description: mkNullOrStrLuaOr' { inherit type description; };
mkNullOrStrLuaFnOr' = mkNullOrStrLuaFnOr' =
{ type, ... }@args: { type, ... }@args: mkNullOrOption' (args // { type = with types; either strLuaFn type; });
mkNullOrOption' (
args
// {
type = with types; either strLuaFn type;
apply = v: if lib.isString v then lib.nixvim.mkRaw v else v;
}
);
mkNullOrStrLuaFnOr = type: description: mkNullOrStrLuaFnOr' { inherit type description; }; mkNullOrStrLuaFnOr = type: description: mkNullOrStrLuaFnOr' { inherit type description; };
defaultNullOpts = defaultNullOpts =