summary refs log tree commit diff
path: root/installer/nixos-hardware-scan.pl
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2008-01-30 14:50:25 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2008-01-30 14:50:25 +0000
commit8e94f3ad67536c26a4ba19aa4da5a5b8a3609386 (patch)
treede5d8a81a15e648a65d8667c68e57d2d0b0c379a /installer/nixos-hardware-scan.pl
parent406d3aafc55186db8acd59d5c2031d837efdd5c6 (diff)
downloadnixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.tar
nixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.tar.gz
nixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.tar.bz2
nixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.tar.lz
nixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.tar.xz
nixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.tar.zst
nixpkgs-8e94f3ad67536c26a4ba19aa4da5a5b8a3609386.zip
* First attempt at detecting services.xserver.videoDriver.
svn path=/nixos/trunk/; revision=10408
Diffstat (limited to 'installer/nixos-hardware-scan.pl')
-rw-r--r--installer/nixos-hardware-scan.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/installer/nixos-hardware-scan.pl b/installer/nixos-hardware-scan.pl
index 4c704862ae8..e96b5b44ee4 100644
--- a/installer/nixos-hardware-scan.pl
+++ b/installer/nixos-hardware-scan.pl
@@ -51,6 +51,7 @@ push @kernelModules, "kvm-amd" if hasCPUFeature "svm";
 # However, some are needed in the initrd to boot the system.
 
 my $enableIntel2200BGFirmware = "false";
+my $videoDriver = "vesa";
 
 sub pciCheck {
     my $path = shift;
@@ -92,6 +93,26 @@ sub pciCheck {
     $enableIntel2200BGFirmware = "true" if $vendor eq "0x8086" &&
         ($device eq "0x1043" || $device eq "0x104f" || $device eq "0x4220" ||
          $device eq "0x4221" || $device eq "0x4223" || $device eq "0x4224");
+
+    # Hm, can we extract the PCI ids supported by X drivers somehow?
+    # cf. http://www.calel.org/pci-devices/xorg-device-list.html
+    $videoDriver = "i810" if $vendor eq "0x8086" &&
+        ($device eq "0x1132" ||
+         $device eq "0x2572" ||
+         $device eq "0x2592" ||
+         $device eq "0x2772" ||
+         $device eq "0x2776" ||
+         $device eq "0x2782" ||
+         $device eq "0x2792" ||
+         $device eq "0x2792" ||
+         $device eq "0x27a2" ||
+         $device eq "0x27a6" ||
+         $device eq "0x3582" ||
+         $device eq "0x7121" ||
+         $device eq "0x7123" ||
+         $device eq "0x7125" ||
+         $device eq "0x7128"
+        );
 }
 
 foreach my $path (glob "/sys/bus/pci/devices/*") {
@@ -184,5 +205,13 @@ print <<EOF ;
     # firmware license, see http://ipw2200.sourceforge.net/firmware.php?fid=7.
     enableIntel2200BGFirmware = $enableIntel2200BGFirmware;
   };
+
+  services = {
+
+    xserver = {
+      videoDriver = "$videoDriver";
+    };
+      
+  };
 }
 EOF