Skip to main content

How to install Lux

This guide covers the various ways to install Lux on your system.

Package managers

Nix and NixOS

Install lux-cli and lux-lua for various Lua versions. You may also need to configure pkg-config so that it can find lux-lua and Lua.

If you would like to use the latest release, the source repository also provides a Nix flake.

Arch Linux

Install the lux-cli package:

pacman -S lux-cli

It comes bundled with shell completions, man pages and lux-lua for the default Lua version. If you want to use lux-lua for a specific Lua version, e.g. Lua 5.1:

pacman -S lua51-lux

Binary distributions

Pre-built binary distributions are available on the releases page. These come bundled with shell completions, man pages and lux-lua for each supported Lua version.

Download the AppImage for your architecture:

  • lx_<version>_x86_64.AppImage
  • lx_<version>_aarch64.AppImage

Make it executable:

chmod u+x lx_<version>_x86_64.AppImage

If your system does not have FUSE, you can extract it instead:

./lx_<version>_<arch>.AppImage --appimage-extract
./squashfs-root/usr/bin/lx

Debian-based distributions can also use the .deb package:

  • lx_<version>_<arch>.deb

Building from source with Cargo

Dependencies

Building Lux from source requires:

  • A Rust toolchain (install via rustup)
  • gnupg, libgpg-error and gpgme (on Unix-like systems)
  • If building without the vendored feature: libgit2 and openssl
  • If building with the vendored feature: perl, perl-core, and make

To link gpgme statically on Linux and macOS, set:

export SYSTEM_DEPS_LINK=static

Install with Cargo

Install through cargo binstall for fastest install times:

cargo binstall lux-cli --locked

If you don't have cargo binstall installed, install Lux normally with:

cargo install lux-cli --locked

Build with vendored dependencies

To statically link libgit2 and openssl:

SYSTEM_DEPS_LINK=static cargo build --locked --profile release --features vendored

Build without vendored dependencies

cargo build --locked --profile release

Build on Windows (MSVC)

The gpgme feature must be disabled on Windows:

cargo build --locked --profile release --no-default-features --features vendored
For new cargo users

Make sure that ~/.cargo/bin/ is part of your shell's $PATH!

export PATH="$HOME/.cargo/bin:$PATH"

For package maintainers

To build lux-lua for a specific Lua version:

cargo xtask51 dist-lua  # Lua 5.1
cargo xtask52 dist-lua # Lua 5.2
cargo xtask53 dist-lua # Lua 5.3
cargo xtask54 dist-lua # Lua 5.4
cargo xtask55 dist-lua # Lua 5.5
cargo xtaskjit dist-lua # LuaJIT

This installs 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 shell completions:

cargo xtask dist-completions

To build man pages:

cargo xtask dist-man

To build the full binary distribution (bundled with completions, man pages, and lux-lua for all supported Lua versions):

cargo xtask dist-package

Verifying the installation

Run lx help to check that Lux installed correctly:

lx help