summary refs log tree commit diff
path: root/nixos/modules/hardware/opengl.nix
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-07-11 13:15:51 -0400
committerGitHub <noreply@github.com>2019-07-11 13:15:51 -0400
commita6ce6c10525f38aadd2c3a8376c2b1a3c16668ec (patch)
tree7e5f0a0143eb63296c6a30025889274298c069b2 /nixos/modules/hardware/opengl.nix
parent1036dc664169b32613ec11b58cc1740c7511a340 (diff)
parent370d3af0c40c30f1dad763c35a2db637f70e6176 (diff)
downloadnixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.tar
nixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.tar.gz
nixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.tar.bz2
nixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.tar.lz
nixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.tar.xz
nixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.tar.zst
nixpkgs-a6ce6c10525f38aadd2c3a8376c2b1a3c16668ec.zip
Merge pull request #61981 from ambrop72/no-opengl-ld-library-path
nixos: Don't set LD_LIBRARY_PATH for graphics drivers that don't need it.
Diffstat (limited to 'nixos/modules/hardware/opengl.nix')
-rw-r--r--nixos/modules/hardware/opengl.nix17
1 files changed, 15 insertions, 2 deletions
diff --git a/nixos/modules/hardware/opengl.nix b/nixos/modules/hardware/opengl.nix
index 2defab51bc3..bfb54e864c2 100644
--- a/nixos/modules/hardware/opengl.nix
+++ b/nixos/modules/hardware/opengl.nix
@@ -118,6 +118,19 @@ in
           set. This can be used to add OpenCL drivers, VA-API/VDPAU drivers etc.
         '';
       };
+
+      setLdLibraryPath = mkOption {
+        type = types.bool;
+        internal = true;
+        default = false;
+        description = ''
+          Whether the <literal>LD_LIBRARY_PATH</literal> environment variable
+          should be set to the locations of driver libraries. Drivers which
+          rely on overriding libraries should set this to true. Drivers which
+          support <literal>libglvnd</literal> and other dispatch libraries
+          instead of overriding libraries should not set this.
+        '';
+      };
     };
 
   };
@@ -145,8 +158,8 @@ in
       )
     ];
 
-    environment.sessionVariables.LD_LIBRARY_PATH =
-      [ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib";
+    environment.sessionVariables.LD_LIBRARY_PATH = mkIf cfg.setLdLibraryPath
+      ([ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib");
 
     environment.variables.XDG_DATA_DIRS =
       [ "/run/opengl-driver/share" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/share";