about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/hardware/video/ati.nix
blob: 0aab7bd6b92c9c2780e2af9ecec8afc0321abcec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# This module provides the proprietary ATI X11 / OpenGL drivers.

{ config, lib, pkgs, ... }:

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 {

    nixpkgs.config.xorg.abiCompat = "1.17";

    services.xserver.drivers = singleton
      { name = "fglrx"; modules = [ ati_x11 ]; };

    hardware.opengl.package = ati_x11;
    hardware.opengl.package32 = pkgs.pkgsi686Linux.linuxPackages.ati_drivers_x11.override { libsOnly = true; kernel = null; };
    hardware.opengl.setLdLibraryPath = true;

    environment.systemPackages = [ ati_x11 ];

    boot.extraModulePackages = [ ati_x11 ];

    boot.blacklistedKernelModules = [ "radeon" ];

    environment.etc.ati.source = "${ati_x11}/etc/ati";

  };

}