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

View file

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