From 51b4d3b7e0088a3ce38056b25037878ed9dd5127 Mon Sep 17 00:00:00 2001 From: Julie Ruffin Date: Sun, 15 Sep 2024 23:59:37 +0200 Subject: [PATCH 1/3] fix: build on non-x86 platforms --- default.nix | 9 +++++++-- nixGL.nix | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index dedc60c..d46e560 100644 --- a/default.nix +++ b/default.nix @@ -12,7 +12,7 @@ # Enable 32 bits driver # This is on by default, you can switch it to off if you want to reduce a # bit the size of nixGL closure. - enable32bits ? true, + enable32bits ? pkgs.stdenv.hostPlatform.isx86, # Make sure to enable config.allowUnfree to the instance of nixpkgs to be # able to access the nvidia drivers. pkgs ? import { @@ -31,4 +31,9 @@ pkgs.callPackage ./nixGL.nix ({ } // (if enableIntelX86Extensions then {} else { intel-media-driver = null; - })) + }) // (if enable32bits then {} + else { + pkgsi686Linux = null; + driversi686Linux = null; + }) +) diff --git a/nixGL.nix b/nixGL.nix index e8556c8..ec2d5d4 100644 --- a/nixGL.nix +++ b/nixGL.nix @@ -242,8 +242,10 @@ let # nixGLNvidia or nixGLIntel using an heuristic. nixGLDefault = if nvidiaVersionAuto != null then nixGLCommon autoNvidia.nixGLNvidia + else if stdenv.hostPlatform.isx86 then + nixGLCommon nixGLIntel else - nixGLCommon nixGLIntel; + nixGLCommon nixGLMesa; } // autoNvidia; }; in top // (if nvidiaVersion != null then From f0715c5ccd332d0965dbb83b510b61127c4f7b0b Mon Sep 17 00:00:00 2001 From: Julie Ruffin Date: Tue, 17 Sep 2024 22:41:50 +0200 Subject: [PATCH 2/3] Improved default.nix according to review feedback Co-authored-by: Sandro --- default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/default.nix b/default.nix index d46e560..5dc544e 100644 --- a/default.nix +++ b/default.nix @@ -31,8 +31,7 @@ pkgs.callPackage ./nixGL.nix ({ } // (if enableIntelX86Extensions then {} else { intel-media-driver = null; - }) // (if enable32bits then {} - else { + }) // (lib.optionalAttrs (!enable32bits) { pkgsi686Linux = null; driversi686Linux = null; }) From e511b9bf622f4e89ec185cdd76aef3c99929c363 Mon Sep 17 00:00:00 2001 From: Julie Ruffin Date: Mon, 14 Oct 2024 23:14:48 +0200 Subject: [PATCH 3/3] Fixed derivation bug on x86 platforms --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 5dc544e..56b3704 100644 --- a/default.nix +++ b/default.nix @@ -31,7 +31,7 @@ pkgs.callPackage ./nixGL.nix ({ } // (if enableIntelX86Extensions then {} else { intel-media-driver = null; - }) // (lib.optionalAttrs (!enable32bits) { + }) // (pkgs.lib.optionalAttrs (!enable32bits) { pkgsi686Linux = null; driversi686Linux = null; })