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