summary refs log tree commit diff
path: root/nixos/doc/manual/configuration/linux-kernel.xml
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-06-08 18:06:47 +0200
committerDaiderd Jordan <daiderd@gmail.com>2018-06-08 18:06:47 +0200
commitfcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74 (patch)
treefc80390e190e04aeb8330522f475be313feac4b8 /nixos/doc/manual/configuration/linux-kernel.xml
parent9dfb0b2db04a42815356e6eabba9fac92ccf4cc4 (diff)
parentb9565143eaa17b7b7e03612769ebc6ca24eddae0 (diff)
downloadnixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.tar
nixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.tar.gz
nixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.tar.bz2
nixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.tar.lz
nixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.tar.xz
nixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.tar.zst
nixlib-fcdcfe2de1ab7c3507c8bb68b5fd347ab7f80c74.zip
Merge branch 'master' into staging
Diffstat (limited to 'nixos/doc/manual/configuration/linux-kernel.xml')
-rw-r--r--nixos/doc/manual/configuration/linux-kernel.xml51
1 files changed, 51 insertions, 0 deletions
diff --git a/nixos/doc/manual/configuration/linux-kernel.xml b/nixos/doc/manual/configuration/linux-kernel.xml
index 6502aaec83e5..f4d697c42dbd 100644
--- a/nixos/doc/manual/configuration/linux-kernel.xml
+++ b/nixos/doc/manual/configuration/linux-kernel.xml
@@ -67,6 +67,57 @@ nixpkgs.config.packageOverrides = pkgs:
   parameters, run <command>sysctl -a</command>.
  </para>
  <section>
+  <title>Customize your kernel</title>
+
+  <para>
+   The first step before compiling the kernel is to generate an appropriate
+   <literal>.config</literal> configuration. Either you pass your own config via
+   the <literal>configfile</literal> setting of <literal>linuxManualConfig</literal>:
+  <screen><![CDATA[
+  custom-kernel = super.linuxManualConfig {
+    inherit (super) stdenv hostPlatform;
+    inherit (linux_4_9) src;
+    version = "${linux_4_9.version}-custom";
+
+    configfile = /home/me/my_kernel_config;
+    allowImportFromDerivation = true;
+  };
+  ]]></screen>
+
+You can edit the config with this snippet (by default <command>make menuconfig</command> won't work
+  out of the box on nixos):
+  <screen><![CDATA[
+      nix-shell -E 'with import <nixpkgs> {}; kernelToOverride.overrideAttrs (o: {nativeBuildInputs=o.nativeBuildInputs ++ [ pkgconfig ncurses ];})'
+  ]]></screen>
+
+
+  or you can let nixpkgs generate the configuration.
+  Nixpkgs generates it via answering the interactive kernel utility <command>make config</command>.
+  The answers depend on parameters passed to <filename>pkgs/os-specific/linux/kernel/generic.nix</filename>
+  (which you can influence by overriding <literal>extraConfig, autoModules, modDirVersion, preferBuiltin, extraConfig</literal>).
+<screen><![CDATA[
+
+  mptcp93.override ({
+      name="mptcp-local";
+
+      ignoreConfigErrors = true;
+      autoModules = false;
+      kernelPreferBuiltin = true;
+
+      enableParallelBuilding = true;
+
+      extraConfig = ''
+        DEBUG_KERNEL y
+        FRAME_POINTER y
+        KGDB y
+        KGDB_SERIAL_CONSOLE y
+        DEBUG_INFO y
+      '';
+    });
+  ]]></screen>
+  </para>
+ </section>
+ <section>
   <title>Developing kernel modules</title>
 
   <para>