lib: switch to mkLuaInline

This commit is contained in:
Ching Pei Yang 2024-03-16 09:29:07 +00:00
commit 77d3cd5e0c
3 changed files with 9 additions and 7 deletions

View file

@ -48,11 +48,13 @@ in rec {
# Convert a list of lua expressions to a lua table. The difference to listToLuaTable is that the elements here are expected to be lua expressions already, whereas listToLuaTable converts from nix types to lua first
luaTable = items: ''{${concatStringsSep "," items}}'';
isLuaInline = {_type ? null, ...}: _type == "lua-inline";
toLuaObject = args:
if isAttrs args
then
if hasAttr "__raw" args
then args.__raw
if isLuaInline args
then args.expr
else if hasAttr "__empty" args
then "{ }"
else