depot/third_party/nixpkgs/pkgs/os-specific/linux/kernel/mainline.nix
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

27 lines
852 B
Nix

{ branch, lib, fetchurl, fetchzip, buildLinux, ... } @ args:
let
allKernels = builtins.fromJSON (builtins.readFile ./kernels-org.json);
thisKernel = allKernels.${branch};
inherit (thisKernel) version;
src =
# testing kernels are a special case because they don't have tarballs on the CDN
if branch == "testing"
then fetchzip {
url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz";
inherit (thisKernel) hash;
}
else fetchurl {
url = "mirror://kernel/linux/kernel/v${lib.versions.major version}.x/linux-${version}.tar.xz";
inherit (thisKernel) hash;
};
args' = (builtins.removeAttrs args ["branch"]) // {
inherit src version;
modDirVersion = lib.versions.pad 3 version;
extraMeta.branch = branch;
} // (args.argsOverride or {});
in
buildLinux args'