Bleeding-edge Mesa from the main branch, packaged as a Nix flake.
Overrides nixpkgs' mesa via overrideAttrs — no derivation rewrite needed. Provides an overlay (mesa-git / mesa-git-32), vendor-aware driver presets, and a NixOS module to swap the system graphics driver in one line.
| Project | https://gitlab.freedesktop.org/mesa/mesa |
| License | MIT |
| Tracked | Git HEAD (main) |
nixpkgs-unstable tracks Mesa stable releases. Mesa main often contains unreleased driver optimizations weeks or months before a stable cut:
- RDNA 4 / GFX12: RadeonSI compute dispatch, buffer/image clears, shader improvements
- RADV: Vulkan driver fixes, new extensions, performance tuning
- NVK / ANV / etc.: Ongoing Vulkan and OpenGL improvements across all drivers
Chaotic-Nyx (the previous community mesa-git source) was archived in December 2025 with no maintained replacement.
| Field | Value |
|---|---|
| Branch | main |
| Rev | 5674327297af |
| Version | 26.2.0-devel |
| Date | 2026-05-06 |
Updated automatically every 12 hours by CI. See version.json for the full commit SHA.
Add as a flake input:
{
inputs.mesa-git = {
url = "github:Daaboulex/mesa-git-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}Then add the overlay:
nixpkgs.overlays = [ inputs.mesa-git.overlays.default ];Import the NixOS module:
imports = [ inputs.mesa-git.nixosModules.default ];# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
mesa-git-nix = {
url = "github:daaboulex/mesa-git-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}The included NixOS module sets hardware.graphics.package and hardware.graphics.package32 for you, with optional vendor-based driver selection.
# configuration.nix or host config
{ inputs, ... }: {
imports = [ inputs.mesa-git-nix.nixosModules.default ];
nixpkgs.overlays = [ inputs.mesa-git-nix.overlays.default ];
mesa-git = {
enable = true;
drivers = [ "amd" ]; # Only compile AMD drivers (see Driver Presets below)
};
}If you manage hardware.graphics.package yourself or want to integrate mesa-git into your own module system:
{ inputs, pkgs, lib, ... }: {
nixpkgs.overlays = [ inputs.mesa-git-nix.overlays.default ];
# All drivers (default)
hardware.graphics.package = lib.mkForce pkgs.mesa-git;
hardware.graphics.package32 = lib.mkForce pkgs.mesa-git-32;
# Or with vendor selection (AMD-only)
hardware.graphics.package = lib.mkForce (pkgs.mkMesaGit { vendors = [ "amd" ]; });
hardware.graphics.package32 = lib.mkForce (pkgs.mkMesaGit32 { vendors = [ "amd" ]; });
}nix build github:daaboulex/mesa-git-nix
nix eval github:daaboulex/mesa-git-nix#mesa-git.versionBy default, mesa-git builds all drivers (same as nixpkgs). Set drivers to only compile what your hardware needs — this dramatically reduces build time.
| Vendor | drivers |
Gallium | Vulkan |
|---|---|---|---|
| AMD | [ "amd" ] |
radeonsi, r600, r300 | RADV |
| Intel | [ "intel" ] |
iris, crocus, i915 | ANV, HasVK |
| NVIDIA | [ "nvidia" ] |
nouveau, tegra | NVK |
| All | [ ] (default) |
all 24 drivers | all 14 drivers |
Regardless of vendor selection, these are always built:
- Gallium: llvmpipe (software fallback), softpipe, zink (OpenGL-over-Vulkan), virgl (VM)
- Vulkan: Lavapipe/swrast (software fallback), virtio (VM)
For systems with multiple GPUs (e.g., Intel iGPU + NVIDIA dGPU), list all vendors:
mesa-git.drivers = [ "intel" "nvidia" ]; # Builds Intel + NVIDIA + common essentialsFor full control, use mkMesaGit / mkMesaGit32 directly:
hardware.graphics.package = lib.mkForce (pkgs.mkMesaGit {
galliumDrivers = [ "radeonsi" "llvmpipe" "zink" ];
vulkanDrivers = [ "amd" "swrast" ];
});The overlay applies overrideAttrs to nixpkgs' mesa derivation, changing only what's necessary:
| Attribute | Change |
|---|---|
version |
26.1.0-dev-<short-rev> |
src |
Pinned git main commit from version.json |
patches |
Cleared (nixpkgs patches target release line numbers) |
postPatch |
Replicates opencl.patch effects via substituteInPlace + sed; skips mesa-gl-headers validation |
mesonFlags |
Driver lists replaced when vendor presets are used |
env.MESON_PACKAGE_CACHE_DIR |
Rebuilt from wraps.json (Rust crate deps matching git main) |
Everything else (build inputs, outputs, postInstall, postFixup) is inherited from nixpkgs.
clang-libdirmeson option — nixpkgs'opencl.patchadds a custom meson option so Nix can control the clang library search path. We replicate this withsubstituteInPlaceonmeson.buildand append the option definition fromclang-libdir-option.meson.- Rusticl ICD install — disables auto-installing the
.icdfile (nixpkgs reconstructs it with an absolute Nix store path inpostInstall). mesa-gl-headerscheck — skipped entirely, since git main headers diverge from the pinned release headers package.
git clone https://github.com/Daaboulex/mesa-git-nix
cd mesa-git-nix
nix develop # enter dev shell, installs pre-commit hooks
nix fmt # format flake + module
nix flake check --no-build # eval check
nix build .#mesa-git # build the package
nix eval .#mesa-git.version # confirm pinned commit + version string./scripts/update.shThis script:
- Fetches the latest commit SHA from
gitlab.freedesktop.org/mesa/mesamain - Computes the source hash with
nix-prefetch-git - Sparse-clones
subprojects/*.wrapto regeneratewraps.json(Rust crate dependencies) - Writes
version.json
After updating, test with:
nix build .#mesa-git
nix eval .#mesa-git.versionCI runs the same chain every 12 hours via .github/workflows/update.yml, so manual updates are rarely needed.
After nixos-rebuild switch:
# OpenGL version should show the git version string
glxinfo | grep "OpenGL version"
# Vulkan driver info should show RADV with git version
vulkaninfo | grep driverInfomesa-git-nix/
├── flake.nix # Flake: overlay + NixOS module + packages
├── flake.lock
├── overlay.nix # Nixpkgs overlay: mesa-git, mkMesaGit, driver presets
├── module.nix # NixOS module: mesa-git.enable + drivers option
├── clang-libdir-option.meson # Meson option snippet (avoids Nix string escaping)
├── version.json # Pinned commit: rev, hash, version, date
├── wraps.json # Rust crate deps for MESON_PACKAGE_CACHE_DIR
├── update.sh # Script to pin latest mesa main commit
├── pkgs/
│ └── mesa-git.nix # Package documentation (build via overlay)
├── LICENSE
└── README.md
This module declares options under mesa-git. See module.nix for all available options.
This packaging flake is MIT licensed. Mesa itself is distributed under the MIT license.
Maintained as part of the Daaboulex NixOS ecosystem.