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.
- Linux
- macOS
- Windows
Download the AppImage for your architecture:
lx_<version>_x86_64.AppImagelx_<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
Download the .dmg for your architecture:
lux-cli_<version>_x86_64.dmglux-cli_<version>_aarch64.dmg
Extract the .app bundle to your Applications folder, then add the
binary to your PATH:
export PATH="/Applications/lux-cli.app/Contents/MacOS:$PATH"
The package is not notarized, so you may need to configure Gatekeeper to allow it.
Download and run the installer:
lx_<version>_x64-setup.exe- or
lx_<version>_x64_en-US.msi
After installing, add the install directory to your PATH.
The package is not signed, so Windows will show a "Windows protected your PC" warning.
Enable a x64 hosted MSVC toolset when using Lux on the command line.
Building from source with Cargo
Dependencies
Building Lux from source requires:
- A Rust toolchain (install via rustup)
gnupg,libgpg-errorandgpgme(on Unix-like systems)- If building without the
vendoredfeature:libgit2andopenssl - If building with the
vendoredfeature:perl,perl-core, andmake
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
Make sure that ~/.cargo/bin/ is part of your shell's $PATH!
- bash / zsh
- fish
- powershell
export PATH="$HOME/.cargo/bin:$PATH"
fish_add_path ~/.cargo/bin
$env:Path = "$HOME\.cargo\bin;$env: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