lib/lua: move wrapLuaConfig to lib & structure arguments

This commit is contained in:
NotAShelf 2024-04-17 03:00:27 +03:00
parent 522a1b9310
commit d2d40362f4
No known key found for this signature in database
GPG Key ID: 02D1DD3FA08B6B29
1 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,16 @@
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
inherit (lib.trivial) boolToString;
in rec {
wrapLuaConfig = {
luaBefore ? "",
luaConfig,
luaAfter ? "",
}: ''
lua << EOF
${concatStringsSep "\n" [luaBefore luaConfig luaAfter]}
EOF
'';
# Convert a null value to lua's nil
nullString = value:
if value == null