summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/manual-config.nix
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2021-07-11 21:58:16 -0700
committerBernardo Meurer <bernardo@meurer.org>2021-07-12 10:39:52 -0700
commitea167e8ccbcae6a3378e622255d9705d26f33058 (patch)
tree78a30854a96fadb0bfda768739c1b1a37158dc66 /pkgs/os-specific/linux/kernel/manual-config.nix
parent89deec56234511babe7478a44f684afcec83b394 (diff)
downloadnixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.tar
nixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.tar.gz
nixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.tar.bz2
nixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.tar.lz
nixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.tar.xz
nixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.tar.zst
nixpkgs-ea167e8ccbcae6a3378e622255d9705d26f33058.zip
buildLinux: take and propagate extraMakeFlags
This is just for practicity, as it allows users of buildLinux to pass
along extra flags they need in the kernel's make invocation. This makes,
for example, supporting LLVM _much_ easier, and could enable us in the
future to provide clang-built kernels.
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index d40a36936a2..77add0aef53 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -19,6 +19,8 @@ in {
   stdenv,
   # The kernel version
   version,
+  # Additional kernel make flags
+  extraMakeFlags ? [],
   # The version of the kernel module directory
   modDirVersion ? version,
   # The kernel source (tarball, git checkout, etc.)
@@ -173,7 +175,9 @@ let
         "KBUILD_BUILD_VERSION=1-NixOS"
         kernelConf.target
         "vmlinux"  # for "perf" and things like that
-      ] ++ optional isModular "modules";
+      ]
+      ++ optional isModular "modules"
+      ++ extraMakeFlags;
 
       installFlags = [
         "INSTALLKERNEL=${installkernel}"
@@ -325,7 +329,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat
     "ARCH=${stdenv.hostPlatform.linuxArch}"
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
-  ];
+  ] ++ extraMakeFlags;
 
   karch = stdenv.hostPlatform.linuxArch;
 })