Skip to main content

FAQ

Why does Lux use TOML instead of Lua for configuration?

Lua was originally designed as a configuration language, and it can be used that way. However, a programmatically editable manifest becomes near impossible when the manifest is arbitrary Lua code. If the dependencies table could be generated by a Lua function with side effects, there's no safe way for Lux to update it.

TOML is declarative and machine-editable. If you prefer Lua, Lux also supports extra.rockspec files using the standard LuaRocks format.

Why is Lux written in Rust (and not Lua)?

Practically: Cargo is a great package manager in its own right, and the Rust ecosystem provides a wealth of libraries for package management tasks: HTTP clients, archive formats, compression, TOML serialisation, and more. Building Lux in Rust meant we could focus on the Lua-specific logic instead of reinventing infrastructure.

Philosophically: Lux is a tool for managing files, networks, and build processes. It is not a Lua library, and it does not replace Lua for Lua tasks. It occupies the same niche as cargo for Rust or uv for Python, a separate tool built in a language suited to systems programming, distribution, and correctness.

How does Lux compare with LuaRocks?

See the Comparison with LuaRocks page for a detailed feature-by-feature breakdown.

Why is the CLI called lx instead of lux?

lux is the SI unit for illuminance, and lx is its symbol. We found it fitting. It is also less likely to clash with other CLI tools.

Does Lux work with LuaJIT?

Yes. Lux detects LuaJIT via pkg-config, and falls back to installing LuaJIT headers using the luajit_src crate if none are found on the system.

Does Lux support Lua dialects like Teal or Luau?

Lux supports Teal in the same way that LuaRocks does. Support for Luau is on the roadmap.

How do I set up LUA_PATH and LUA_CPATH?

Use lx path:

eval "$(lx path)"

This is the equivalent of eval "$(luarocks path --bin)", but faster. You can also use lx run to execute packages with the environment already set up.

Can I install a package directly from a git host?

Yes. In lux.toml, declare a git dependency with the git field:

[dependencies.my-dep]
version = "0951178" # commit SHA or tag
git = "codeberg:user/repository"

See the lux.toml guide for details.

Note that rocks with git dependencies cannot be uploaded to LuaRocks, because luarocks cannot build them.

Does Lux work on Windows?

Yes. Lux ships prebuilt binaries for x86_64 Windows (MSVC). Support for compiling C dependencies on Windows is a work in progress.

I use Nix. Why would I need Lux?

Lux and Nix solve different problems. Lux manages Lua dependencies and builds. Nix is a general-purpose package manager and build system. Many Lux users also use Nix. In fact, one of Lux's design goals is to improve the nixpkgs Lua ecosystem by providing a reliable upstream build tool.

I found a bug or have a feature request. Where do I report it?

Open an issue at github.com/nvim-neorocks/lux.