Nix Flake
ashell provides a flake.nix for reproducible builds and development environments.
Development Shell
nix develop
This provides:
- Latest stable Rust toolchain via
rust-overlay rust-analyzerfor editor integration- All native build dependencies (Wayland, PipeWire, PulseAudio, etc.)
- Correct
LD_LIBRARY_PATHfor runtime libraries RUST_SRC_PATHset for rust-analyzer
Building with Nix
nix build
The built binary includes a wrapper that sets LD_LIBRARY_PATH for runtime dependencies (Wayland, Vulkan, Mesa, OpenGL).
Flake Inputs
| Input | Purpose |
|---|---|
crane | Rust build system for Nix |
nixpkgs | Package repository (nixos-unstable channel) |
rust-overlay | Rust toolchain overlay |
Build Dependencies
buildInputs = [
rustToolchain.default
rustPlatform.bindgenHook # For C library bindings
pkg-config
libxkbcommon
libGL
pipewire
libpulseaudio
wayland
vulkan-loader
udev
];
Runtime Dependencies
runtimeDependencies = [
libpulseaudio
wayland
mesa
vulkan-loader
libGL
libglvnd
];
The postInstall step wraps the binary with wrapProgram to set LD_LIBRARY_PATH:
postInstall = ''
wrapProgram "$out/bin/ashell" --prefix LD_LIBRARY_PATH : "${ldLibraryPath}"
'';