diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.22.nix b/pkgs/os-specific/linux/kernel/linux-2.6.22.nix index 3154c2559bc6..bb51a5f6b524 100644 --- a/pkgs/os-specific/linux/kernel/linux-2.6.22.nix +++ b/pkgs/os-specific/linux/kernel/linux-2.6.22.nix @@ -15,7 +15,11 @@ , # Your own kernel configuration file, if you don't want to use the # default. - kernelConfig ? null + kernelConfig ? null + +, # A list of additional statements to be appended to the + # configuration file. + extraConfig ? [] }: assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; @@ -38,7 +42,11 @@ stdenv.mkDerivation { }; patches = map (p: p.patch) kernelPatches; - extraConfig = lib.concatStrings (map (p: "\n" + (if p ? extraConfig then p.extraConfig else "") + "\n") kernelPatches); + extraConfig = + let addNewlines = map (s: "\n" + s + "\n"); + configFromPatches = + map (p: if p ? extraConfig then p.extraConfig else "") kernelPatches; + in lib.concatStrings (addNewlines (configFromPatches ++ extraConfig)); config = if kernelConfig != null then kernelConfig else