From 9e75b7c917be99bf9d187c2e44032ad05644e4cd Mon Sep 17 00:00:00 2001 From: elwrcl Date: Fri, 5 Jun 2026 21:33:26 +0300 Subject: [PATCH] uhh --- flake.nix | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/flake.nix b/flake.nix index 7e1127f..087ac5e 100644 --- a/flake.nix +++ b/flake.nix @@ -3,20 +3,34 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - mesa-src = { - url = "git+https://gitlab.freedesktop.org/mesa/mesa?rev=1a8953c9562d779f2d2730900a85ab5f446fff12"; - flake = false; - }; }; - outputs = { self, nixpkgs, mesa-src }: + outputs = { self, nixpkgs }: let - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; + systems = ["x86_64-linux"]; + + forAllSystems = f: nixpkgs.lib.genAttrs systems f; in { - packages.${system}.mesa-custom = pkgs.mesa.overrideAttrs (old: { - src = mesa-src; - patches = [ ./hd4000-custom.patch ]; - }); + packages = forAllSystems (system: + let + pkgs = import nixpkgs { inherit system; }; + + buildCustomMesa = pkgs: pkgs.mesa.overrideAttrs (old: { + patches = (old.patches or []) ++ [ + (pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/elwrcl/intel-hard-graphics/main/hd4000-custom.patch"; + hash = ""; # İlk build'de hash al + }) + ]; + mesonFlags = (old.mesonFlags or []) ++ [ "-Dgallium-rusticl=true" ]; + }); + + in { + mesa-custom = buildCustomMesa pkgs; + mesa-custom-32 = if system == "x86_64-linux" then + buildCustomMesa pkgs.pkgsi686Linux + else null; + } + ); }; } \ No newline at end of file