From 587b1cbf21bb818f83580edd7444a2587e873078 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sat, 16 Nov 2024 14:24:06 +0000 Subject: [PATCH] lib/types: allow inline-lua in `rawLua` type --- lib/types.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index 150a6604..9a5e637b 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -14,7 +14,7 @@ let name = "strLua"; inherit description; descriptionClass = "noun"; - check = v: lib.isString v || isRawType v; + check = v: lib.isString v || types.rawLua.check v; merge = loc: defs: lib.pipe defs [ @@ -24,7 +24,8 @@ let (lib.options.mergeEqualOption loc) ]; }; - isRawType = v: v ? __raw && lib.isString v.__raw; + + isRawType = v: lib.isString (v.__raw or null); in rec { # TODO: deprecate in favor of types.rawLua.check @@ -36,7 +37,7 @@ rec { description = "raw lua code"; descriptionClass = "noun"; merge = lib.options.mergeEqualOption; - check = v: (isRawType v) || (v ? __empty); + check = v: isRawType v || lib.nixvim.lua.isInline v || v ? __empty; }; maybeRaw =