diff --git a/pkgs/luaUtils.nix b/pkgs/luaUtils.nix index 490d5c9..51605d6 100644 --- a/pkgs/luaUtils.nix +++ b/pkgs/luaUtils.nix @@ -70,15 +70,18 @@ let listToLua = list: assert builtins.isList list; - let - wrap = (lib.elemAt list 0) != "__unpack"; - strippedList = if wrap then list else (lib.drop 1 list); - in - lib.concatStrings [ - (optionalString wrap "{") - (concatStringsSep "," (map toLua strippedList)) - (optionalString wrap "}") - ]; + if list != [ ] then + let + wrap = (lib.elemAt list 0) != "__unpack"; + strippedList = if wrap then list else (lib.drop 1 list); + in + lib.concatStrings [ + (optionalString wrap "{") + (concatStringsSep "," (map toLua strippedList)) + (optionalString wrap "}") + ] + else + "{}"; /** Converts a nix set into its Lua representation.