lol

nixos opengl: add extraPackages and extraPackages32

+32 -4
+32 -4
nixos/modules/hardware/opengl.nix
··· 10 10 11 11 videoDrivers = config.services.xserver.videoDrivers; 12 12 13 - makePackage = p: p.buildEnv { 13 + makePackage = p: pkgs.buildEnv { 14 14 name = "mesa-drivers+txc-${p.mesa_drivers.version}"; 15 15 paths = 16 16 [ p.mesa_drivers 17 17 p.mesa_noglu # mainly for libGL 18 18 (if cfg.s3tcSupport then p.libtxc_dxtn else p.libtxc_dxtn_s2tc) 19 19 ]; 20 + }; 21 + 22 + package = pkgs.buildEnv { 23 + name = "opengl-drivers"; 24 + paths = [ cfg.package ] ++ cfg.extraPackages; 25 + }; 26 + 27 + package32 = pkgs.buildEnv { 28 + name = "opengl-drivers-32bit"; 29 + paths = [ cfg.package32 ] ++ cfg.extraPackages32; 20 30 }; 21 31 22 32 in ··· 75 85 internal = true; 76 86 description = '' 77 87 The package that provides the 32-bit OpenGL implementation on 78 - 64-bit systems. Used when <option>driSupport32Bit</option> is 88 + 64-bit systems. Used when <option>driSupport32Bit</option> is 89 + set. 90 + ''; 91 + }; 92 + 93 + hardware.opengl.extraPackages = mkOption { 94 + type = types.listOf types.package; 95 + default = []; 96 + description = '' 97 + Additional packages to add to OpenGL drivers. 98 + ''; 99 + }; 100 + 101 + hardware.opengl.extraPackages32 = mkOption { 102 + type = types.listOf types.package; 103 + default = []; 104 + description = '' 105 + Additional packages to add to 32-bit OpenGL drivers on 106 + 64-bit systems. Used when <option>driSupport32Bit</option> is 79 107 set. 80 108 ''; 81 109 }; ··· 91 119 92 120 system.activationScripts.setup-opengl = 93 121 '' 94 - ln -sfn ${cfg.package} /run/opengl-driver 122 + ln -sfn ${package} /run/opengl-driver 95 123 ${if pkgs.stdenv.isi686 then '' 96 124 ln -sfn opengl-driver /run/opengl-driver-32 97 125 '' else if cfg.driSupport32Bit then '' 98 - ln -sfn ${cfg.package32} /run/opengl-driver-32 126 + ln -sfn ${package32} /run/opengl-driver-32 99 127 '' else '' 100 128 rm -f /run/opengl-driver-32 101 129 ''}