10000 GitHub - nvim-neorocks/lux: A luxurious package manager for Lua
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nvim-neorocks/lux

Repository files navigation


Lux

Lux

A luxurious package manager for Lua.

GitHub Actions Workflow Status GitHub Top Language GitHub License

Key Features β€’ How To Use β€’ Comparison with Luarocks β€’ Related Projects β€’ Contributing

🌟 Key Features

  • Create and manage Lua projects
    • Easily manage dependencies, build steps and more through the lux.toml file.
  • Parallel builds and installs πŸš€
  • Add/remove dependencies with simple CLI commands
  • Automatic generation of rockspecs
    • Say goodbye to managing 10 different rockspec files in your source code πŸŽ‰
  • Integrated code formatting via lx fmt
  • Easily specify compatible Lua versions
    • Lux will take care of Lua header installation automatically
    • Forget about users complaining they have the wrong Lua headers installed on their system
  • Automatic code linting via lx check
    • Powered by luacheck.
  • Powerful lockfile support
    • Makes for fully reproducible developer environments.
    • Makes Lux easy to integrate with Nix!
  • Fully compatible
    • Works with existing luarocks packages.
    • Have a complex rockspec that you don't want to rewrite to TOML? No problem! Lux allows the creation of an extra.rockspec file, everything just works.
    • Have a very complex build script? Lux can shell out to luarocks if it knows it has to preserve maximum compatibility.

Warning

Lux, while generally functional, is a work in progress and does not have a 1.0 release yet.

βš™οΈ How To Use

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.

πŸ“Š Comparison with luarocks

As 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.11.1
project format TOML / Lua Lua
add/remove dependencies βœ… ❌
parallel builds/installs βœ… ❌
proper lockfile support with integrity checks βœ… ❌ (basic, dependency versions only)
run tests with busted βœ… βœ…
linting with luacheck βœ… ❌
code formatting with stylua βœ… ❌
automatic lua detection/installation βœ… ❌
default build specs βœ… βœ…
custom build backends βœ…1 βœ…
rust-mlua build spec βœ… (builtin) βœ… (external build backend)
treesitter-parser build spec βœ… (builtin) βœ… (external build backend)
install pre-built binary rocks βœ… βœ…
install multiple packages with a single command βœ… ❌
install packages using version constraints βœ… ❌
auto-detect external dependencies and Lua headers with pkg-config βœ… ❌
resolve multiple versions of the same dependency at runtime βœ… βœ…
pack and upload pre-built binary rocks βœ… βœ…
luarocks.org manifest namespaces βœ… βœ…
luarocks.org dev packages βœ… βœ…
versioning SemVer2 arbitrary
rockspecs with CVS/Mercurial/SVN/SSCM sources ❌ (YAGNI3) βœ…
static type checking ❌ (planned) ❌
git dependencies in local projects βœ… ❌

πŸ“¦ Packages

lux-cli packaging status lux-lua packaging status

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.
    • A work-in-progress API for embedding Lux into Lua applications. We provide builds of 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-lua as a Lua library using Lux. See #663. Lux can detect a lux-lua installation using pkg-config or via the LUX_LIB_DIR environment variable.

πŸ”§ Building from source

Dependencies:

  • openssl
  • libgit2
  • gnupg, libgpg-error and gpgme (*nix only)
  • lua (optional, if building without the vendored-lua feature)

We recommend building with the vendored-lua feature enabled:

cargo build --features vendored-lua

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/<lua>/lux.so and a pkg-config .pc file to target/dist/lib/lux-lua*.pc.

❄️ Nix flake

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.1
  • lux-lua52 The Lux Lua API for Lua 5.2
  • lux-lua53 The Lux Lua API for Lua 5.3
  • lux-lua54 The Lux Lua API for Lua 5.4
  • lux-luajit The Lux Lua API for Luajit

If you have a lux-lua build and pkg-config in a Nix devShell, Lux will auto-detect lux-lua.

πŸ’‘ You may also like...

  • luarocks - The original Lua package manager
  • rocks.nvim - A Neovim plugin manager that uses luarocks under the hood, and will soon be undergoing a rewrite to use Lux instead.

πŸ’œ Credits

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.

πŸ’š Contributing

Contributions are more than welcome! See CONTRIBUTING.md for a guide.

πŸ“– License

  • Lux is licensed under MIT.
  • The Lux logo Β© 2025 by Kai Jakobi is licensed under CC BY-NC-SA 4.0.

Footnotes

  1. Supported via a compatibility layer that uses luarocks as a backend. ↩

  2. 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. ↩

  3. You Aren't Gonna Need It. ↩

0