diff --git a/nixos/doc/manual/configuration/linux-kernel.xml b/nixos/doc/manual/configuration/linux-kernel.xml index 529ac1b1cd46..2675220b3a80 100644 --- a/nixos/doc/manual/configuration/linux-kernel.xml +++ b/nixos/doc/manual/configuration/linux-kernel.xml @@ -9,12 +9,14 @@ . For instance, this selects the Linux 3.10 kernel: - = pkgs.linuxPackages_3_10; + = pkgs.linuxKernel.packages.linux_3_10; Note that this not only replaces the kernel, but also packages that are - specific to the kernel version, such as the NVIDIA video drivers. This - ensures that driver packages are consistent with the kernel. - +specific to the kernel version, such as the NVIDIA video drivers. This ensures that driver packages are consistent with the kernel. + + + While pkgs.linuxKernel.packages contains all available kernel packages, you may want to use one of the unversioned pkgs.linuxPackages_* aliases such as pkgs.linuxPackages_latest, that are kept up to date with new versions. + The default Linux kernel configuration should be fine for most users. You can see the configuration of your current kernel with the following command: @@ -27,14 +29,13 @@ zcat /proc/config.gz linkend="sec-customising-packages" />). For instance, to enable support for the kernel debugger KGDB: -nixpkgs.config.packageOverrides = pkgs: - { linux_3_4 = pkgs.linux_3_4.override { - extraConfig = - '' - KGDB y - ''; - }; +nixpkgs.config.packageOverrides = pkgs: pkgs.lib.recursiveUpdate pkgs { + linuxKernel.kernels.linux_5_10 = pkgs.linuxKernel.kernels.linux_5_10.override { + extraConfig = '' + KGDB y + ''; }; +}; extraConfig takes a list of Linux kernel configuration options, one per line. The name of the option should not include the prefix @@ -73,15 +74,16 @@ nixpkgs.config.packageOverrides = pkgs: The first step before compiling the kernel is to generate an appropriate .config configuration. Either you pass your own config via the configfile setting of - linuxManualConfig: + linuxKernel.manualConfig: You can edit the config with this snippet (by default make