{"id":50168329,"url":"https://github.com/daaboulex/mesa-git-nix","last_synced_at":"2026-05-24T22:04:08.411Z","repository":{"id":341685354,"uuid":"1171075633","full_name":"Daaboulex/mesa-git-nix","owner":"Daaboulex","description":"Mesa from git main packaged for NixOS — bleeding-edge GPU drivers","archived":false,"fork":false,"pushed_at":"2026-05-19T09:31:47.000Z","size":149,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-19T09:59:05.504Z","etag":null,"topics":["bleeding-edge","flake","gpu","mesa","mesa-git","nix","nixos","opengl","radeonsi","radv","vulkan"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Daaboulex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-02T21:06:59.000Z","updated_at":"2026-05-19T09:31:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Daaboulex/mesa-git-nix","commit_stats":null,"previous_names":["daaboulex/mesa-git-nix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Daaboulex/mesa-git-nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Fmesa-git-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Fmesa-git-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Fmesa-git-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Fmesa-git-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daaboulex","download_url":"https://codeload.github.com/Daaboulex/mesa-git-nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Fmesa-git-nix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33452035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T19:21:36.376Z","status":"ssl_error","status_checked_at":"2026-05-24T19:21:10.562Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bleeding-edge","flake","gpu","mesa","mesa-git","nix","nixos","opengl","radeonsi","radv","vulkan"],"created_at":"2026-05-24T22:03:42.184Z","updated_at":"2026-05-24T22:04:08.405Z","avatar_url":"https://github.com/Daaboulex.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mesa-git-nix\n\n\u003c!-- BEGIN generated:badges --\u003e\n[![CI](https://github.com/Daaboulex/mesa-git-nix/actions/workflows/ci.yml/badge.svg)](https://github.com/Daaboulex/mesa-git-nix/actions/workflows/ci.yml)\n[![NixOS unstable](https://img.shields.io/badge/NixOS-unstable-78C0E8?logo=nixos\u0026logoColor=white)](https://nixos.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\u003c!-- END generated:badges --\u003e\n\nBleeding-edge [Mesa](https://www.mesa3d.org/) from the `main` branch, packaged as a Nix flake.\n\nOverrides 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.\n\n\u003c!-- BEGIN generated:upstream --\u003e\n## Upstream\n\n| | |\n|---|---|\n| **Project** | https://gitlab.freedesktop.org/mesa/mesa |\n| **License** | MIT |\n| **Tracked** | Git HEAD (main) |\n\u003c!-- END generated:upstream --\u003e\n\n## Why?\n\nnixpkgs-unstable tracks Mesa stable releases. Mesa `main` often contains unreleased driver optimizations weeks or months before a stable cut:\n\n- **RDNA 4 / GFX12**: RadeonSI compute dispatch, buffer/image clears, shader improvements\n- **RADV**: Vulkan driver fixes, new extensions, performance tuning\n- **NVK / ANV / etc.**: Ongoing Vulkan and OpenGL improvements across all drivers\n\n[Chaotic-Nyx](https://github.com/chaotic-cx/nyx) (the previous community mesa-git source) was archived in December 2025 with no maintained replacement.\n\n## Pinned Commit\n\n| Field   | Value |\n|---------|-------|\n| Branch  | `main` |\n| Rev     | [`52d57d98a294`](https://gitlab.freedesktop.org/mesa/mesa/-/commit/52d57d98a2948214a2d029f2f4e8b476bf39ada3) |\n| Version | `26.2.0-devel` |\n| Date    | 2026-05-19 |\n\nUpdated automatically every 12 hours by CI. See [`version.json`](./version.json) for the full commit SHA.\n\n\u003c!-- BEGIN generated:installation --\u003e\n## Installation\n\nAdd as a flake input:\n\n```nix\n{\n  inputs.mesa-git = {\n    url = \"github:Daaboulex/mesa-git-nix\";\n    inputs.nixpkgs.follows = \"nixpkgs\";\n  };\n}\n```\n\nThen add the overlay:\n\n```nix\nnixpkgs.overlays = [ inputs.mesa-git.overlays.default ];\n```\n\nImport the NixOS module:\n\n```nix\nimports = [ inputs.mesa-git.nixosModules.default ];\n```\n\u003c!-- END generated:installation --\u003e\n\n## Usage\n\n### Flake Input\n\n```nix\n# flake.nix\n{\n  inputs = {\n    nixpkgs.url = \"github:NixOS/nixpkgs/nixos-unstable\";\n    mesa-git-nix = {\n      url = \"github:daaboulex/mesa-git-nix\";\n      inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n  };\n}\n```\n\n### Option A: NixOS Module (Recommended)\n\nThe included NixOS module sets `hardware.graphics.package` and `hardware.graphics.package32` for you, with optional vendor-based driver selection.\n\n```nix\n# configuration.nix or host config\n{ inputs, ... }: {\n  imports = [ inputs.mesa-git-nix.nixosModules.default ];\n\n  nixpkgs.overlays = [ inputs.mesa-git-nix.overlays.default ];\n\n  mesa-git = {\n    enable = true;\n    drivers = [ \"amd\" ];  # Only compile AMD drivers (see Driver Presets below)\n  };\n}\n```\n\n### Option B: Overlay Only\n\nIf you manage `hardware.graphics.package` yourself or want to integrate mesa-git into your own module system:\n\n```nix\n{ inputs, pkgs, lib, ... }: {\n  nixpkgs.overlays = [ inputs.mesa-git-nix.overlays.default ];\n\n  # All drivers (default)\n  hardware.graphics.package = lib.mkForce pkgs.mesa-git;\n  hardware.graphics.package32 = lib.mkForce pkgs.mesa-git-32;\n\n  # Or with vendor selection (AMD-only)\n  hardware.graphics.package = lib.mkForce (pkgs.mkMesaGit { vendors = [ \"amd\" ]; });\n  hardware.graphics.package32 = lib.mkForce (pkgs.mkMesaGit32 { vendors = [ \"amd\" ]; });\n}\n```\n\n### Option C: Standalone Build\n\n```bash\nnix build github:daaboulex/mesa-git-nix\nnix eval github:daaboulex/mesa-git-nix#mesa-git.version\n```\n\n## Driver Presets\n\nBy default, mesa-git builds **all** drivers (same as nixpkgs). Set `drivers` to only compile what your hardware needs — this dramatically reduces build time.\n\n### Vendor Presets\n\n| Vendor | `drivers` | Gallium | Vulkan |\n|--------|-----------|---------|--------|\n| AMD | `[ \"amd\" ]` | radeonsi, r600, r300 | RADV |\n| Intel | `[ \"intel\" ]` | iris, crocus, i915 | ANV, HasVK |\n| NVIDIA | `[ \"nvidia\" ]` | nouveau, tegra | NVK |\n| All | `[ ]` (default) | all 24 drivers | all 14 drivers |\n\n### Common Essentials (Always Included)\n\nRegardless of vendor selection, these are always built:\n\n- **Gallium**: llvmpipe (software fallback), softpipe, zink (OpenGL-over-Vulkan), virgl (VM)\n- **Vulkan**: Lavapipe/swrast (software fallback), virtio (VM)\n\n### Multi-GPU / Integrated Graphics\n\nFor systems with multiple GPUs (e.g., Intel iGPU + NVIDIA dGPU), list all vendors:\n\n```nix\nmesa-git.drivers = [ \"intel\" \"nvidia\" ];  # Builds Intel + NVIDIA + common essentials\n```\n\n### Custom Driver Lists\n\nFor full control, use `mkMesaGit` / `mkMesaGit32` directly:\n\n```nix\nhardware.graphics.package = lib.mkForce (pkgs.mkMesaGit {\n  galliumDrivers = [ \"radeonsi\" \"llvmpipe\" \"zink\" ];\n  vulkanDrivers = [ \"amd\" \"swrast\" ];\n});\n```\n\n## How It Works\n\nThe overlay applies `overrideAttrs` to nixpkgs' `mesa` derivation, changing only what's necessary:\n\n| Attribute | Change |\n|-----------|--------|\n| `version` | `26.1.0-dev-\u003cshort-rev\u003e` |\n| `src` | Pinned git main commit from `version.json` |\n| `patches` | Cleared (nixpkgs patches target release line numbers) |\n| `postPatch` | Replicates `opencl.patch` effects via `substituteInPlace` + `sed`; skips `mesa-gl-headers` validation |\n| `mesonFlags` | Driver lists replaced when vendor presets are used |\n| `env.MESON_PACKAGE_CACHE_DIR` | Rebuilt from `wraps.json` (Rust crate deps matching git main) |\n\nEverything else (build inputs, outputs, `postInstall`, `postFixup`) is inherited from nixpkgs.\n\n### What the `postPatch` Does\n\n1. **`clang-libdir` meson option** — nixpkgs' `opencl.patch` adds a custom meson option so Nix can control the clang library search path. We replicate this with `substituteInPlace` on `meson.build` and append the option definition from `clang-libdir-option.meson`.\n2. **Rusticl ICD install** — disables auto-installing the `.icd` file (nixpkgs reconstructs it with an absolute Nix store path in `postInstall`).\n3. **`mesa-gl-headers` check** — skipped entirely, since git main headers diverge from the pinned release headers package.\n\n## Development\n\n```bash\ngit clone https://github.com/Daaboulex/mesa-git-nix\ncd mesa-git-nix\nnix develop                       # enter dev shell, installs pre-commit hooks\nnix fmt                           # format flake + module\nnix flake check --no-build        # eval check\nnix build .#mesa-git              # build the package\nnix eval .#mesa-git.version       # confirm pinned commit + version string\n```\n\n### Updating the pin\n\n```bash\n./scripts/update.sh\n```\n\nThis script:\n\n1. Fetches the latest commit SHA from `gitlab.freedesktop.org/mesa/mesa` `main`\n2. Computes the source hash with `nix-prefetch-git`\n3. Sparse-clones `subprojects/*.wrap` to regenerate `wraps.json` (Rust crate dependencies)\n4. Writes `version.json`\n\nAfter updating, test with:\n\n```bash\nnix build .#mesa-git\nnix eval .#mesa-git.version\n```\n\nCI runs the same chain every 12 hours via `.github/workflows/update.yml`, so manual updates are rarely needed.\n\n## Verification\n\nAfter `nixos-rebuild switch`:\n\n```bash\n# OpenGL version should show the git version string\nglxinfo | grep \"OpenGL version\"\n\n# Vulkan driver info should show RADV with git version\nvulkaninfo | grep driverInfo\n```\n\n## Repository Structure\n\n```\nmesa-git-nix/\n├── flake.nix                   # Flake: overlay + NixOS module + packages\n├── flake.lock\n├── overlay.nix                 # Nixpkgs overlay: mesa-git, mkMesaGit, driver presets\n├── module.nix                  # NixOS module: mesa-git.enable + drivers option\n├── clang-libdir-option.meson   # Meson option snippet (avoids Nix string escaping)\n├── version.json                # Pinned commit: rev, hash, version, date\n├── wraps.json                  # Rust crate deps for MESON_PACKAGE_CACHE_DIR\n├── update.sh                   # Script to pin latest mesa main commit\n├── pkgs/\n│   └── mesa-git.nix            # Package documentation (build via overlay)\n├── LICENSE\n└── README.md\n```\n\n\u003c!-- BEGIN generated:options --\u003e\n## Options\n\nThis module declares options under `mesa-git`. See [`module.nix`](module.nix) for all available options.\n\u003c!-- END generated:options --\u003e\n\n## License\n\nThis packaging flake is [MIT](./LICENSE) licensed. Mesa itself is distributed under the [MIT license](https://docs.mesa3d.org/license.html).\n\n\u003c!-- BEGIN generated:footer --\u003e\n---\n\n*Maintained as part of the [Daaboulex](https://github.com/Daaboulex) NixOS ecosystem.*\n\u003c!-- END generated:footer --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaaboulex%2Fmesa-git-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaaboulex%2Fmesa-git-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaaboulex%2Fmesa-git-nix/lists"}