mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
lib: switch to mkLuaInline
This commit is contained in:
parent
5ea6272bee
commit
77d3cd5e0c
3 changed files with 9 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue