From bd6aa476b81aa543a437afa347ba2b6a7eec694f Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 29 Sep 2024 15:13:49 +0100 Subject: [PATCH] lib/options: remove redundant `mkRaw` `apply` functions `strLua` now does this coercion internally. --- lib/options.nix | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/lib/options.nix b/lib/options.nix index ca113d68..9e184c50 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -90,48 +90,18 @@ rec { mkNullOrStr' = args: mkNullOrOption' (args // { type = with types; maybeRaw str; }); mkNullOrStr = description: mkNullOrStr' { inherit description; }; - mkNullOrLua' = - args: - mkNullOrOption' ( - args - // { - type = types.strLua; - apply = lib.nixvim.mkRaw; - } - ); + mkNullOrLua' = args: mkNullOrOption' (args // { type = types.strLua; }); mkNullOrLua = description: mkNullOrLua' { inherit description; }; - mkNullOrLuaFn' = - args: - mkNullOrOption' ( - args - // { - type = types.strLuaFn; - apply = lib.nixvim.mkRaw; - } - ); + mkNullOrLuaFn' = args: mkNullOrOption' (args // { type = types.strLuaFn; }); mkNullOrLuaFn = description: mkNullOrLua' { inherit description; }; mkNullOrStrLuaOr' = - { type, ... }@args: - mkNullOrOption' ( - args - // { - type = with types; either strLua type; - apply = v: if lib.isString v then lib.nixvim.mkRaw v else v; - } - ); + { type, ... }@args: mkNullOrOption' (args // { type = with types; either strLua type; }); mkNullOrStrLuaOr = type: description: mkNullOrStrLuaOr' { inherit type description; }; mkNullOrStrLuaFnOr' = - { type, ... }@args: - mkNullOrOption' ( - args - // { - type = with types; either strLuaFn type; - apply = v: if lib.isString v then lib.nixvim.mkRaw v else v; - } - ); + { type, ... }@args: mkNullOrOption' (args // { type = with types; either strLuaFn type; }); mkNullOrStrLuaFnOr = type: description: mkNullOrStrLuaFnOr' { inherit type description; }; defaultNullOpts =