aboutsummaryrefslogtreecommitdiff
path: root/pkgs/os-specific/linux/kernel-headers
diff options
context:
space:
mode:
authorMaciej Woś <maciej.wos@gmail.com>2019-05-23 17:36:27 +0900
committerMaciej Woś <maciej.wos@gmail.com>2019-05-23 17:48:52 +0900
commit5a7c98df12acc75403b40f3581037bfc4a7e3423 (patch)
tree2891e694e8efea681cf25e80831ba7c78ac5308c /pkgs/os-specific/linux/kernel-headers
parent6858eda213973a89abcdb5bcf09eb16346889e9d (diff)
nixos/kernel-headers: makeLinuxHeaders
While it is easy to make a custom kernel by applying kernelPatches it is not so easy to get the corresponding headers; the derivation uses a hard-coded kernel version.
Diffstat (limited to 'pkgs/os-specific/linux/kernel-headers')
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix30
1 files changed, 16 insertions, 14 deletions
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
index ea4e041d43a..cc3e039d241 100644
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -4,13 +4,10 @@
}:
let
- common = { version, sha256, patches ? [] }: stdenvNoCC.mkDerivation {
- name = "linux-headers-${version}";
+ makeLinuxHeaders = { src, version, patches ? [] }: stdenvNoCC.mkDerivation {
+ inherit src;
- src = fetchurl {
- url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
- inherit sha256;
- };
+ name = "linux-headers-${version}";
ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or stdenvNoCC.hostPlatform.kernelArch;
@@ -73,13 +70,18 @@ let
};
};
in {
+ inherit makeLinuxHeaders;
- linuxHeaders = common {
- version = "4.19.16";
- sha256 = "1pqvn6dsh0xhdpawz4ag27vkw1abvb6sn3869i4fbrz33ww8i86q";
- patches = [
- ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
- ./no-dynamic-cc-version-check.patch # so we can use `stdenvNoCC`, see `makeFlags` above
- ];
- };
+ linuxHeaders = let version = "4.19.16"; in
+ makeLinuxHeaders {
+ inherit version;
+ src = fetchurl {
+ url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
+ sha256 = "1pqvn6dsh0xhdpawz4ag27vkw1abvb6sn3869i4fbrz33ww8i86q";
+ };
+ patches = [
+ ./no-relocs.patch # for building x86 kernel headers on non-ELF platforms
+ ./no-dynamic-cc-version-check.patch # so we can use `stdenvNoCC`, see `makeFlags` above
+ ];
+ };
}