ati_unfree: Create a nixos module for the ati_unfree x11 driver and
blacklist the radeon driver when ati_unfree is installed.
This commit is contained in:
parent
9a48f9d1b6
commit
c16874c4c0
@ -104,22 +104,9 @@ in
|
|||||||
environment.sessionVariables.LD_LIBRARY_PATH =
|
environment.sessionVariables.LD_LIBRARY_PATH =
|
||||||
[ "/run/opengl-driver/lib" "/run/opengl-driver-32/lib" ];
|
[ "/run/opengl-driver/lib" "/run/opengl-driver-32/lib" ];
|
||||||
|
|
||||||
# FIXME: move this into card-specific modules.
|
hardware.opengl.package = mkDefault (makePackage pkgs);
|
||||||
hardware.opengl.package = mkDefault
|
|
||||||
(if elem "ati_unfree" videoDrivers then
|
|
||||||
kernelPackages.ati_drivers_x11
|
|
||||||
else
|
|
||||||
makePackage pkgs);
|
|
||||||
|
|
||||||
hardware.opengl.package32 = mkDefault (makePackage pkgs_i686);
|
hardware.opengl.package32 = mkDefault (makePackage pkgs_i686);
|
||||||
|
|
||||||
boot.extraModulePackages =
|
boot.extraModulePackages = optional (elem "virtualbox" videoDrivers) kernelPackages.virtualboxGuestAdditions;
|
||||||
optional (elem "virtualbox" videoDrivers) kernelPackages.virtualboxGuestAdditions ++
|
|
||||||
optional (elem "ati_unfree" videoDrivers) kernelPackages.ati_drivers_x11;
|
|
||||||
|
|
||||||
environment.etc =
|
|
||||||
optionalAttrs (elem "ati_unfree" videoDrivers) {
|
|
||||||
"ati".source = "${kernelPackages.ati_drivers_x11}/etc/ati";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
37
nixos/modules/hardware/video/ati.nix
Normal file
37
nixos/modules/hardware/video/ati.nix
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# This module provides the proprietary ATI X11 / OpenGL drivers.
|
||||||
|
|
||||||
|
{ config, lib, pkgs, pkgs_i686, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
drivers = config.services.xserver.videoDrivers;
|
||||||
|
|
||||||
|
enabled = elem "ati_unfree" drivers;
|
||||||
|
|
||||||
|
ati_x11 = config.boot.kernelPackages.ati_drivers_x11;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = mkIf enabled {
|
||||||
|
|
||||||
|
services.xserver.drivers = singleton
|
||||||
|
{ name = "fglrx"; modules = [ ati_x11 ]; libPath = [ "${ati_x11}/lib" ]; };
|
||||||
|
|
||||||
|
hardware.opengl.package = ati_x11;
|
||||||
|
#hardware.opengl.package32 = pkgs_i686.linuxPackages.ati_x11.override { libsOnly = true; kernel = null; };
|
||||||
|
|
||||||
|
environment.systemPackages = [ ati_x11 ];
|
||||||
|
|
||||||
|
boot.extraModulePackages = [ ati_x11 ];
|
||||||
|
|
||||||
|
boot.blacklistedKernelModules = [ "radeon" ];
|
||||||
|
|
||||||
|
environment.etc."ati".source = "${ati_x11}/etc/ati";
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -38,6 +38,7 @@
|
|||||||
./hardware/pcmcia.nix
|
./hardware/pcmcia.nix
|
||||||
./hardware/video/bumblebee.nix
|
./hardware/video/bumblebee.nix
|
||||||
./hardware/video/nvidia.nix
|
./hardware/video/nvidia.nix
|
||||||
|
./hardware/video/ati.nix
|
||||||
./installer/tools/nixos-checkout.nix
|
./installer/tools/nixos-checkout.nix
|
||||||
./installer/tools/tools.nix
|
./installer/tools/tools.nix
|
||||||
./misc/assertions.nix
|
./misc/assertions.nix
|
||||||
|
@ -13,7 +13,6 @@ let
|
|||||||
|
|
||||||
# Map video driver names to driver packages. FIXME: move into card-specific modules.
|
# Map video driver names to driver packages. FIXME: move into card-specific modules.
|
||||||
knownVideoDrivers = {
|
knownVideoDrivers = {
|
||||||
ati_unfree = { modules = [ kernelPackages.ati_drivers_x11 ]; driverName = "fglrx"; };
|
|
||||||
nouveau = { modules = [ pkgs.xf86_video_nouveau ]; };
|
nouveau = { modules = [ pkgs.xf86_video_nouveau ]; };
|
||||||
unichrome = { modules = [ pkgs.xorgVideoUnichrome ]; };
|
unichrome = { modules = [ pkgs.xorgVideoUnichrome ]; };
|
||||||
virtualbox = { modules = [ kernelPackages.virtualboxGuestAdditions ]; driverName = "vboxvideo"; };
|
virtualbox = { modules = [ kernelPackages.virtualboxGuestAdditions ]; driverName = "vboxvideo"; };
|
||||||
@ -444,8 +443,7 @@ in
|
|||||||
pkgs.xterm
|
pkgs.xterm
|
||||||
pkgs.xdg_utils
|
pkgs.xdg_utils
|
||||||
]
|
]
|
||||||
++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh
|
++ optional (elem "virtualbox" cfg.videoDrivers) xorg.xrefresh;
|
||||||
++ optional (elem "ati_unfree" cfg.videoDrivers) kernelPackages.ati_drivers_x11;
|
|
||||||
|
|
||||||
environment.pathsToLink =
|
environment.pathsToLink =
|
||||||
[ "/etc/xdg" "/share/xdg" "/share/applications" "/share/icons" "/share/pixmaps" ];
|
[ "/etc/xdg" "/share/xdg" "/share/applications" "/share/icons" "/share/pixmaps" ];
|
||||||
@ -465,8 +463,6 @@ in
|
|||||||
XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime.
|
XORG_DRI_DRIVER_PATH = "/run/opengl-driver/lib/dri"; # !!! Depends on the driver selected at runtime.
|
||||||
LD_LIBRARY_PATH = concatStringsSep ":" (
|
LD_LIBRARY_PATH = concatStringsSep ":" (
|
||||||
[ "${xorg.libX11}/lib" "${xorg.libXext}/lib" ]
|
[ "${xorg.libX11}/lib" "${xorg.libXext}/lib" ]
|
||||||
++ optionals (elem "ati_unfree" cfg.videoDrivers)
|
|
||||||
[ "${kernelPackages.ati_drivers_x11}/lib" "${kernelPackages.ati_drivers_x11}/X11R6/lib64/modules/linux" ]
|
|
||||||
++ concatLists (catAttrs "libPath" cfg.drivers));
|
++ concatLists (catAttrs "libPath" cfg.drivers));
|
||||||
} // cfg.displayManager.job.environment;
|
} // cfg.displayManager.job.environment;
|
||||||
|
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
# There is one issue left:
|
# There is one issue left:
|
||||||
# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
|
# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
|
||||||
|
|
||||||
# You eventually have to blacklist radeon module (?)
|
|
||||||
|
|
||||||
assert stdenv.system == "x86_64-linux";
|
assert stdenv.system == "x86_64-linux";
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user