about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2022-12-20 16:49:27 +0100
committerNaïm Favier <n@monade.li>2022-12-22 01:42:15 +0100
commita8fd50b79c899b3b4958f8bb95bb5717906a37b6 (patch)
treed3dbd014eeb9cf678103b96e0dd3ef648d0e21cc /pkgs/os-specific
parent6c563f30fe9415fff6ab33df738a7b9ddc84cf4e (diff)
nixos/doc: update custom kernel instructions
Document the `linux.override` way first, then `linuxManualConfig`.

Add a `linux.configEnv` passthru attribute for quickly getting a
`make nconfig`-ready shell.
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 51ad268a5fe73..5a39ef9150006 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -206,6 +206,15 @@ let
     features = kernelFeatures;
     inherit commonStructuredConfig structuredExtraConfig extraMakeFlags isZen isHardened isLibre;
     isXen = lib.warn "The isXen attribute is deprecated. All Nixpkgs kernels that support it now have Xen enabled." true;
+
+    # Adds dependencies needed to edit the config:
+    # nix-shell '<nixpkgs>' -A linux.configEnv --command 'make nconfig'
+    configEnv = kernel.overrideAttrs (old: {
+      nativeBuildInputs = old.nativeBuildInputs or [] ++ (with buildPackages; [
+        pkg-config ncurses
+      ]);
+    });
+
     passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]);
     tests = let
       overridableKernel = finalKernel // {