| Crates.io | lux-lib |
| lib.rs | lux-lib |
| version | 0.25.1 |
| created_at | 2025-02-18 21:27:16.961657+00 |
| updated_at | 2025-09-24 17:38:50.225229+00 |
| description | Library for the lux package manager for Lua |
| homepage | https://lux.lumen-labs.org |
| repository | https://github.com/lumen-oss/lux |
| max_upload_size | |
| id | 1560479 |
| size | 1,072,380 |
Key Features • How To Use • Comparison with Luarocks • Related Projects • Contributing
lux.toml file.lx fmt
stylua.lx check
emmylua-analyzer-rustlx lint
luacheckextra.rockspec file, everything just works.luarocks if it knows it has
to preserve maximum compatibility..luarc.json
file so they can be picked up by lua-language-server.[!WARNING]
Lux, while generally functional, is a work in progress and does not have a
1.0release yet.
Feel free to consult the documentation on how to get started with Lux!
It features a tutorial and several guides to make you good at managing Lua projects.
luarocksAs this project is still a work in progress, some luarocks features have not been (fully) implemented yet. On the other hand, lux has some features that are not present in luarocks.
The following table provides a brief comparison:
| lux | luarocks v3.12.2 | |
|---|---|---|
| project format | TOML / Lua | Lua |
| add/remove dependencies | :white_check_mark: | :x: |
| parallel builds/installs | :white_check_mark: | :x: |
| proper lockfile support with integrity checks | :white_check_mark: | :x: (basic, dependency versions only) |
| run tests with busted | :white_check_mark: | :white_check_mark: |
| linting with luacheck | :white_check_mark: | :x: |
| code formatting with stylua | :white_check_mark: | :x: |
| automatic lua detection/installation | :white_check_mark: | :x: |
| default build specs | :white_check_mark: | :white_check_mark: |
| custom build backends | :white_check_mark:1 | :white_check_mark: |
rust-mlua build spec |
:white_check_mark: (builtin) | :white_check_mark: (external build backend) |
treesitter-parser build spec |
:white_check_mark: (builtin) | :white_check_mark: (external build backend) |
| install pre-built binary rocks | :white_check_mark: | :white_check_mark: |
| install multiple packages with a single command | :white_check_mark: | :x: |
| install packages using version constraints | :white_check_mark: | :x: |
auto-detect external dependencies and Lua headers with pkg-config |
:white_check_mark: | :x: |
| resolve multiple versions of the same dependency at runtime | :white_check_mark: | :white_check_mark: |
| pack and upload pre-built binary rocks | :white_check_mark: | :white_check_mark: |
| luarocks.org manifest namespaces | :white_check_mark: | :white_check_mark: |
| luarocks.org dev packages | :white_check_mark: | :white_check_mark: |
| versioning | SemVer2 | arbitrary |
| rockspecs with CVS/Mercurial/SVN/SSCM sources | :x: (YAGNI3) | :white_check_mark: |
| static type checking | :white_check_mark: | :x: |
generate a .luarc file with dependencies |
:x: (planned) | :x: |
| git dependencies in local projects | :white_check_mark: | :x: |
Lux includes the following packages and libraries:
lux-cli: The main CLI for interacting with projects and installing Lua packages
from the command line.
lux-lua: The Lux Lua API, which provides:
lux.loader for resolving dependencies on require at runtime.lux-lua for Lua 5.1, 5.2, 5.3, 5.4 and Luajit.
lux-cli uses lux-lua for commands like lx lua, lx run and lx path.lux-lib: The Lux library for Rust. A dependency of lux-cli and lux-lua.
[!NOTE]
We do not yet provide a way to install
lux-luaas a Lua library using Lux. See #663. Lux can detect a lux-lua installation using pkg-config or via theLUX_LIB_DIRenvironment variable.Our pre-built binary release artifacts are bundled with
lux-lua.
Dependencies:
gnupg, libgpg-error and gpgme (*nix only)If building without the vendored feature:
lualibgit2opensslIf building with the vendored feature:
perl and perl-coremakeTo link gpgme statically on Linux and macOS, set the environment variable
SYSTEM_DEPS_LINK=static.
We usually recommend building with the vendored feature enabled,
to statically link lua, libgit2 and openssl:
SYSTEM_DEPS_LINK="static" cargo build --locked --profile release --features vendored
Or, to build with dynamically linked libraries:
cargo build --locked --profile release
On Windows/MSVC, you must disable the gpgme feature:
cargo build --locked --profile release --no-default-features --features lua54,vendored
You can build lux-lua for a given Lua version with:
cargo xtask51 dist-lua # lux-lua for Lua 5.1
cargo xtask52 dist-lua # for Lua 5.2
cargo xtask53 dist-lua # ...
cargo xtask54 dist-lua
cargo xtaskjit dist-lua
This will install lux-lua to target/dist/share/lux-lua/<lua>/lux.so
and a pkg-config .pc file to target/dist/lib/lux-lua*.pc.
To build completions:
cargo xtask dist-completions
To build man pages:
cargo xtask dist-man
To build the binary distributions for your platform,
bundled with completions, man pages and lux-lua:
cargo xtask dist-package
If you would like to use the latest version of lux with Nix, you can import our flake. It provides an overlay and packages for:
lux-cli: The Lux CLI package.lux-lua51 The Lux Lua API for Lua 5.1lux-lua52 The Lux Lua API for Lua 5.2lux-lua53 The Lux Lua API for Lua 5.3lux-lua54 The Lux Lua API for Lua 5.4lux-luajit The Lux Lua API for LuajitIf you have a lux-lua build and pkg-config in a Nix devShell,
Lux will auto-detect lux-lua.
luarocks under the hood, and will soon be undergoing a rewrite to use Lux instead.Credits go to the Luarocks team for maintaining luarocks and luarocks.org for as long as they have. Without their prior work Lux would not be possible.
Contributions are more than welcome! See CONTRIBUTING.md for a guide.
Supported via a compatibility layer that uses luarocks as a backend. ↩
Mostly compatible with the luarocks version parser, which allows an arbitrary number of version components. To comply with SemVer, we treat anything after the third version component (except for the specrev) as a prerelease/build version. ↩