nixpkgs_local/linux_surface/default.nix

80 lines
1.9 KiB
Nix

{ stdenv, buildPackages, fetchurl, perl, buildLinux, modDirVersionArg ? null, ... } @ args:
with stdenv.lib;
buildLinux (args // rec {
version = "4.19.25";
# modDirVersion needs to be x.y.z, will automatically add .0 if needed
modDirVersion = if (modDirVersionArg == null) then concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))) else modDirVersionArg;
# branchVersion needs to be x.y
extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version)));
src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "0ccpj57pv2rw78a4j5mg9sz7a37k0sn5glbn2rs6yvp9ss81vivy";
};
kernelPatches = [
{
name = "modinst-arg-list-too-long";
patch = ./patches/modinst-arg-list-too-long.patch;
}
{
name = "bridge-stp-helper";
patch = ./patches/bridge-stp-helper.patch;
}
{
name = "surface-acpi";
patch = ./patches/0001-surface-acpi.patch;
}
{
name = "resume-delay";
patch = ./patches/0002-resume-delay.patch;
}
{
name = "buttons";
patch = ./patches/0003-buttons.patch;
}
{
name = "cameras";
patch = ./patches/0004-cameras.patch;
}
{
name = "ipts";
patch = ./patches/0005-ipts.patch;
}
{
name = "hid";
patch = ./patches/0006-hid.patch;
}
{
name = "sdcard-reader";
patch = ./patches/0007-sdcard-reader.patch;
}
{
name = "wifi";
patch = ./patches/0008-wifi.patch;
}
{
name = "surface3-power";
patch = ./patches/0009-surface3-power.patch;
}
{
name = "surface-dock";
patch = ./patches/0010-surface-dock.patch;
}
{
name = "mwlwifi";
patch = ./patches/0011-mwlwifi.patch;
}
];
extraConfig = ''
I2C_DESIGNWARE_PLATFORM m
X86_INTEL_LPSS y
''
+ (args.extraConfig or "");
} // (args.argsOverride or {}))