* Reformat.

svn path=/nixos/trunk/; revision=18970
This commit is contained in:
Eelco Dolstra 2009-12-15 14:10:06 +00:00
parent a612fd0d5e
commit e8372257a1

View File

@ -2,15 +2,18 @@
with pkgs.lib;
###### interface
let
let kernel = config.boot.kernelPackages.kernel; in
{
###### interface
options = {
boot = {
kernelPackages = mkOption {
boot.kernelPackages = mkOption {
default = pkgs.kernelPackages;
example = pkgs.kernelPackages_2_6_25;
description = "
description = ''
This option allows you to override the Linux kernel used by
NixOS. Since things like external kernel module packages are
tied to the kernel you're using, it also overrides those.
@ -21,10 +24,10 @@ let
configuration. For instance, if you use the NVIDIA X driver,
then it also needs to contain an attribute
<varname>nvidia_x11</varname>.
";
'';
};
kernelParams = mkOption {
boot.kernelParams = mkOption {
default = [
"selinux=0"
"apm=on"
@ -33,33 +36,26 @@ let
"splash=verbose"
"vga=0x317"
];
description = "
description = ''
The kernel parameters. If you want to add additional
parameters, it's best to set
<option>boot.extraKernelParams</option>.
";
};
extraKernelParams = mkOption {
default = [
];
example = [
"debugtrace"
];
description = "
Additional user-defined kernel parameters.
";
};
extraModulePackages = mkOption {
default = [];
# !!! example = [pkgs.aufs pkgs.nvidia_x11];
description = ''
A list of additional packages supplying kernel modules.
'';
};
kernelModules = mkOption {
boot.extraKernelParams = mkOption {
default = [ ];
example = [ "debugtrace" ];
description = "Additional user-defined kernel parameters.";
};
boot.extraModulePackages = mkOption {
default = [];
# !!! example = [pkgs.aufs pkgs.nvidia_x11];
description = "A list of additional packages supplying kernel modules.";
};
boot.kernelModules = mkOption {
default = [];
description = ''
The set of kernel modules to be loaded in the second stage of
@ -69,9 +65,7 @@ let
'';
};
initrd = {
kernelModules = mkOption {
boot.initrd.kernelModules = mkOption {
default = [
# Note: most of these (especially the SATA/PATA modules)
# shouldn't be included by default since nixos-hardware-scan
@ -113,7 +107,7 @@ let
"unix"
"i8042" "pcips2" "serio" "atkbd" "xtkbd"
];
description = "
description = ''
The set of kernel modules in the initial ramdisk used during the
boot process. This set must include all modules necessary for
mounting the root device. That is, it should include modules
@ -122,44 +116,38 @@ let
closed under the module dependency relation, i.e., all
dependencies of the modules list here are included
automatically.
";
};
};
'';
};
system.modulesTree = mkOption {
internal = true;
default = [];
description = "
description = ''
Tree of kernel modules. This includes the kernel, plus modules
built outside of the kernel. Combine these into a single tree of
symlinks because modprobe only supports one directory.
";
'';
merge = mergeListOption;
# Convert the list of path to only one path.
apply = pkgs.aggregateModules;
};
};
in
###### implementation
let
kernelPackages = config.boot.kernelPackages;
kernel = kernelPackages.kernel;
in
###### implementation
{
require = [ options ];
config = {
system.build = { inherit kernel; };
system.modulesTree = [ kernel ] ++ config.boot.extraModulePackages;
boot.kernelModules = [ "loop" ];
# The Linux kernel >= 2.6.27 provides firmware.
hardware.firmware = [ "${kernel}/lib/firmware" ];
};
}