commit 1ba64e0199585749519bd749681d56b27201dd8b
parent 3ef7bffcae5b436f35dde8abb268f89080a38453
Author: Guillaume Bouchard <guillaum.bouchard@gmail.com>
Date: Sun, 26 Apr 2020 16:29:46 +0200
Add support for 32bit in nixGLIntel
This closes #30. OpenGL support for 32bit is unconditionnally added to
nixGLIntel.
- Nvidia with bumblebee seems to work out of the box. I don't know why.
- I don't have the hardware to test vulkan.
- I don't have the hardware to test pure nvidia.
Diffstat:
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/default.nix b/default.nix
@@ -1,6 +1,10 @@
{ system ? builtins.currentSystem,
nvidiaVersion ? null,
nvidiaHash ? null,
+ # Enable 32 bits driver
+ # This is one by default, you can switch it to off if you want to reduce a
+ # bit the size of nixGL closure.
+ enable32bits ? true,
pkgs ? import <nixpkgs>
}:
@@ -51,6 +55,7 @@ rec {
kernel = null;
};
+ # TODO: 32bit version? Looks like it works fine without anything special.
nixGLNvidiaBumblebee = writeExecutable {
name = "nixGLNvidiaBumblebee";
text = ''
@@ -60,6 +65,7 @@ rec {
'';
};
+ # TODO: 32bit version? Not tested.
nixNvidiaWrapper = api: writeExecutable {
name = "nix${api}Nvidia";
text = ''
@@ -75,23 +81,28 @@ rec {
'';
};
+ # TODO: 32bit version? Not tested.
nixGLNvidia = nixNvidiaWrapper "GL";
+ # TODO: 32bit version? Not tested.
nixVulkanNvidia = nixNvidiaWrapper "Vulkan";
nixGLIntel = writeExecutable {
name = "nixGLIntel";
- text = ''
+ # add the 32 bits drivers if needed
+ text = let
+ drivers = [mesa_drivers] ++ lib.optional enable32bits pkgsi686Linux.mesa_drivers;
+ in ''
#!/usr/bin/env sh
- export LIBGL_DRIVERS_PATH=${lib.makeSearchPathOutput "lib" "lib/dri" [mesa_drivers]}
+ export LIBGL_DRIVERS_PATH=${lib.makeSearchPathOutput "lib" "lib/dri" drivers}
export LD_LIBRARY_PATH=${
- lib.makeLibraryPath [
- mesa_drivers]
+ lib.makeLibraryPath drivers
}:$LD_LIBRARY_PATH
"$@"
'';
};
+ # TODO: 32 bit version? Not tested.
nixVulkanIntel = writeExecutable {
name = "nixVulkanIntel";
text = ''