* Added an option to enable support for 32-bit binaries (such as Wine
or Google Earth) on 64-bit NixOS on NVIDIA hardware. The 32-bit OpenGL library is symlinked from /var/run/opengl-driver-32, which is added to the LD_LIBRARY_PATH so that 32-bit binaries can find it. svn path=/nixos/trunk/; revision=22062
This commit is contained in:
parent
540c673364
commit
eb4c33eeca
@ -33,6 +33,7 @@ rec {
|
|||||||
inherit pkgs modules baseModules;
|
inherit pkgs modules baseModules;
|
||||||
modulesPath = ../modules;
|
modulesPath = ../modules;
|
||||||
servicesPath = services;
|
servicesPath = services;
|
||||||
|
pkgs_i686 = import nixpkgs { system = "i686-linux"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# Import Nixpkgs, allowing the NixOS option nixpkgs.config to
|
# Import Nixpkgs, allowing the NixOS option nixpkgs.config to
|
||||||
|
@ -3,7 +3,7 @@ if [ -n "$NOSYSBASHRC" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Initialise a bunch of environment variables.
|
# Initialise a bunch of environment variables.
|
||||||
export LD_LIBRARY_PATH=/var/run/opengl-driver/lib
|
export LD_LIBRARY_PATH=/var/run/opengl-driver/lib:/var/run/opengl-driver-32/lib # !!! only set if needed
|
||||||
export MODULE_DIR=@modulesTree@/lib/modules
|
export MODULE_DIR=@modulesTree@/lib/modules
|
||||||
export NIXPKGS_CONFIG=/nix/etc/config.nix
|
export NIXPKGS_CONFIG=/nix/etc/config.nix
|
||||||
export NIXPKGS_ALL=/etc/nixos/nixpkgs
|
export NIXPKGS_ALL=/etc/nixos/nixpkgs
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, pkgs_i686, ... }:
|
||||||
|
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
@ -199,6 +199,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
driSupport32Bit = mkOption {
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
On 64-bit systems, whether to support Direct Rendering for
|
||||||
|
32-bit applications (such as Wine). This is currently only
|
||||||
|
supported for the <literal>nvidia</literal> driver.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
startOpenSSHAgent = mkOption {
|
startOpenSSHAgent = mkOption {
|
||||||
default = true;
|
default = true;
|
||||||
description = ''
|
description = ''
|
||||||
@ -420,12 +429,14 @@ in
|
|||||||
''
|
''
|
||||||
rm -f /var/run/opengl-driver
|
rm -f /var/run/opengl-driver
|
||||||
${# !!! The OpenGL driver depends on what's detected at runtime.
|
${# !!! The OpenGL driver depends on what's detected at runtime.
|
||||||
if elem "nvidia" driverNames then ''
|
if elem "nvidia" driverNames then
|
||||||
|
''
|
||||||
ln -sf ${kernelPackages.nvidia_x11} /var/run/opengl-driver
|
ln -sf ${kernelPackages.nvidia_x11} /var/run/opengl-driver
|
||||||
|
${optionalString (pkgs.stdenv.system == "x86_64-linux" && cfg.driSupport32Bit)
|
||||||
|
"ln -sf ${pkgs_i686.linuxPackages.nvidia_x11.override { libsOnly = true; kernel = null; } } /var/run/opengl-driver-32"}
|
||||||
''
|
''
|
||||||
else if elem "nvidiaLegacy" driverNames then ''
|
else if elem "nvidiaLegacy" driverNames then
|
||||||
ln -sf ${kernelPackages.nvidia_x11_legacy} /var/run/opengl-driver
|
"ln -sf ${kernelPackages.nvidia_x11_legacy} /var/run/opengl-driver"
|
||||||
''
|
|
||||||
else if cfg.driSupport then
|
else if cfg.driSupport then
|
||||||
"ln -sf ${pkgs.mesa} /var/run/opengl-driver"
|
"ln -sf ${pkgs.mesa} /var/run/opengl-driver"
|
||||||
else ""
|
else ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user