* Bring back the options to enable/disable the Intel firmwares.

svn path=/nixos/branches/modular-nixos/; revision=16574
This commit is contained in:
Eelco Dolstra 2009-08-04 08:50:02 +00:00
parent c8705704e1
commit 32bb5b2d0f
5 changed files with 59 additions and 32 deletions

View file

@ -1,11 +1,34 @@
{pkgs, config, ...}:
{
services = {
udev = {
# Warning: setting this option requires acceptance of the firmware
# license, see http://ipw2200.sourceforge.net/firmware.php?fid=7.
addFirmware = [ pkgs.ipw2200fw ];
###### interface
options = {
networking.enableIntel2200BGFirmware = pkgs.lib.mkOption {
default = false;
type = pkgs.lib.types.bool;
description = ''
Turn on this option if you want firmware for the Intel
PRO/Wireless 2200BG to be loaded automatically. This is
required if you want to use this device. Intel requires you to
accept the license for this firmware, see
<link xlink:href='http://ipw2200.sourceforge.net/firmware.php?fid=7'/>.
'';
};
};
}
###### implementation
config = pkgs.lib.mkIf config.networking.enableIntel2200BGFirmware {
# Warning: setting this option requires acceptance of the firmware
# license, see http://ipw2200.sourceforge.net/firmware.php?fid=7.
services.udev.addFirmware = [ pkgs.ipw2200fw ];
};
}

View file

@ -1,22 +1,29 @@
{pkgs, config, ...}:
let
inherit (config.boot) kernelPackages;
in
# !!! make this optional
{
boot = {
extraModulePackages =
pkgs.lib.optional
(!kernelPackages.kernel.features ? iwlwifi)
kernelPackages.iwlwifi;
###### interface
options = {
networking.enableIntel3945ABGFirmware = pkgs.lib.mkOption {
default = false;
type = pkgs.lib.types.bool;
description = ''
This option enables automatic loading of the firmware for the Intel
PRO/Wireless 3945ABG.
'';
};
};
services = {
udev = {
addFirmware = [ pkgs.iwlwifi3945ucode ];
};
###### implementation
config = pkgs.lib.mkIf config.networking.enableIntel3945ABGFirmware {
services.udev.addFirmware = [ pkgs.iwlwifi3945ucode ];
};
}

View file

@ -4,7 +4,7 @@ use File::Spec;
use File::Basename;
my @requireList = ();
my @attrs = ();
my @kernelModules = ();
my @initrdKernelModules = ();
@ -96,12 +96,12 @@ sub pciCheck {
# Can't rely on $module here, since the module may not be loaded
# due to missing firmware. Ideally we would check modules.pcimap
# here.
push @requireList, "./nixos/hardware/network/intel-2200bg.nix" if
push @attrs, "networking.enableIntel2200BGFirmware = true;" if
$vendor eq "0x8086" &&
($device eq "0x1043" || $device eq "0x104f" || $device eq "0x4220" ||
$device eq "0x4221" || $device eq "0x4223" || $device eq "0x4224");
push @requireList, "./nixos/hardware/network/intel-3945abg.nix" if
push @attrs, "networking.enableIntel3945ABGFirmware = true;" if
$vendor eq "0x8086" &&
($device eq "0x4229" || $device eq "0x4230" ||
$device eq "0x4222" || $device eq "0x4227");
@ -202,7 +202,7 @@ sub multiLineList {
my $indent = shift;
my $res = "";
foreach my $s (@_) {
$res .= "\n$indent $s";
$res .= "\n$indent$s";
}
$res .= "\n$indent";
return $res;
@ -210,19 +210,18 @@ sub multiLineList {
my $initrdKernelModules = toNixExpr(removeDups @initrdKernelModules);
my $kernelModules = toNixExpr(removeDups @kernelModules);
my $requireList = multiLineList(" ", removeDups @requireList);
my $attrs = multiLineList(" ", removeDups @attrs);
print <<EOF ;
# This is a generated file. Do not modify!
# Make changes to /etc/nixos/configuration.nix instead.
{
require = [$requireList];
boot.initrd.extraKernelModules = [ $initrdKernelModules ];
boot.kernelModules = [ $kernelModules ];
nix.maxJobs = $cpus;
services.xserver.videoDriver = "$videoDriver";
$attrs
}
EOF

View file

@ -1,4 +0,0 @@
# CD-DVD modules are not generic.
# Avoid all modules from ./installer/cd-dvd/
./installer/cd-dvd/*

View file

@ -8,6 +8,8 @@
./config/timezone.nix
./config/unix-odbc-drivers.nix
./config/users-groups.nix
./hardware/network/intel-2200bg.nix
./hardware/network/intel-3945abg.nix
./hardware/pcmcia.nix
./installer/grub/grub.nix
./installer/tools/nixos-checkout.nix