summary refs log tree commit diff
path: root/nixos/modules/hardware/opengl.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-01-25 02:57:15 +0300
committerNikolay Amiantov <ab@fmap.me>2016-01-26 13:42:39 +0300
commit1ae1791e8e8b047d2a45221845ca40ed7f928503 (patch)
tree6c85d1f077cc74c8a35111013dc646b479436b39 /nixos/modules/hardware/opengl.nix
parent768f7d19b54843db8c44030f34d237c013973e40 (diff)
downloadnixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.tar
nixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.tar.gz
nixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.tar.bz2
nixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.tar.lz
nixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.tar.xz
nixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.tar.zst
nixpkgs-1ae1791e8e8b047d2a45221845ca40ed7f928503.zip
nixos opengl: add extraPackages and extraPackages32
Diffstat (limited to 'nixos/modules/hardware/opengl.nix')
-rw-r--r--nixos/modules/hardware/opengl.nix36
1 files changed, 32 insertions, 4 deletions
diff --git a/nixos/modules/hardware/opengl.nix b/nixos/modules/hardware/opengl.nix
index 7693bd5bb45..fabdfad869c 100644
--- a/nixos/modules/hardware/opengl.nix
+++ b/nixos/modules/hardware/opengl.nix
@@ -10,7 +10,7 @@ let
 
   videoDrivers = config.services.xserver.videoDrivers;
 
-  makePackage = p: p.buildEnv {
+  makePackage = p: pkgs.buildEnv {
     name = "mesa-drivers+txc-${p.mesa_drivers.version}";
     paths =
       [ p.mesa_drivers
@@ -19,6 +19,16 @@ let
       ];
   };
 
+  package = pkgs.buildEnv {
+    name = "opengl-drivers";
+    paths = [ cfg.package ] ++ cfg.extraPackages;
+  };
+
+  package32 = pkgs.buildEnv {
+    name = "opengl-drivers-32bit";
+    paths = [ cfg.package32 ] ++ cfg.extraPackages32;
+  };
+
 in
 
 {
@@ -75,7 +85,25 @@ in
       internal = true;
       description = ''
         The package that provides the 32-bit OpenGL implementation on
-        64-bit systems.  Used when <option>driSupport32Bit</option> is
+        64-bit systems. Used when <option>driSupport32Bit</option> is
+        set.
+      '';
+    };
+
+    hardware.opengl.extraPackages = mkOption {
+      type = types.listOf types.package;
+      default = [];
+      description = ''
+        Additional packages to add to OpenGL drivers.
+      '';
+    };
+
+    hardware.opengl.extraPackages32 = mkOption {
+      type = types.listOf types.package;
+      default = [];
+      description = ''
+        Additional packages to add to 32-bit OpenGL drivers on
+        64-bit systems. Used when <option>driSupport32Bit</option> is
         set.
       '';
     };
@@ -91,11 +119,11 @@ in
 
     system.activationScripts.setup-opengl =
       ''
-        ln -sfn ${cfg.package} /run/opengl-driver
+        ln -sfn ${package} /run/opengl-driver
         ${if pkgs.stdenv.isi686 then ''
           ln -sfn opengl-driver /run/opengl-driver-32
         '' else if cfg.driSupport32Bit then ''
-          ln -sfn ${cfg.package32} /run/opengl-driver-32
+          ln -sfn ${package32} /run/opengl-driver-32
         '' else ''
           rm -f /run/opengl-driver-32
         ''}