From 207bfc6e694a1da256e25fc69a96172bf40995a0 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 31 May 2024 19:16:50 +0100 Subject: [PATCH] lib/options: add `mkNullOrLua'` variant --- lib/options.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/options.nix b/lib/options.nix index a630127c..6311f49b 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -32,14 +32,16 @@ rec { mkNullOrStr' = args: mkNullOrOption' (args // { type = with nixvimTypes; maybeRaw str; }); mkNullOrStr = description: mkNullOrStr' { inherit description; }; - mkNullOrLua = - desc: - lib.mkOption { - type = lib.types.nullOr nixvimTypes.strLua; - default = null; - description = desc; - apply = mkRaw; - }; + mkNullOrLua' = + args: + mkNullOrOption' ( + args + // { + type = nixvimTypes.strLua; + apply = mkRaw; + } + ); + mkNullOrLua = description: mkNullOrLua' { inherit description; }; mkNullOrLuaFn = desc: