2023-12-25 22:57:09 +01:00
|
|
|
{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand
|
|
|
|
, ... } @ args:
|
2022-08-25 17:17:01 +02:00
|
|
|
|
|
|
|
let
|
2024-12-10 01:51:20 +01:00
|
|
|
version = "6.12.4";
|
2024-11-23 11:17:34 +01:00
|
|
|
majorVersion = lib.elemAt (lib.take 1 (lib.splitVersion version)) 0;
|
2024-07-06 06:23:26 +02:00
|
|
|
|
2022-08-25 17:17:01 +02:00
|
|
|
patchRepo = fetchFromGitHub {
|
|
|
|
owner = "t2linux";
|
|
|
|
repo = "linux-t2-patches";
|
2024-11-23 11:17:34 +01:00
|
|
|
rev = "539eea1f9127f1623794ee8c7ccc37e8b00f60a3";
|
|
|
|
hash = "sha256-pFeNOLTqnEupyEZDk+fX/5GFpobvN+L7Wv2K6V5Xx9g=";
|
2022-08-25 17:17:01 +02:00
|
|
|
};
|
|
|
|
|
2024-07-06 06:23:26 +02:00
|
|
|
kernel = fetchzip {
|
|
|
|
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
2024-12-10 01:51:20 +01:00
|
|
|
hash = "sha256-SiQzaqraT/5s6Mown8/DeOWU7VR3IG0ojvkqThO09+0=";
|
2024-07-06 06:23:26 +02:00
|
|
|
};
|
2022-08-25 17:17:01 +02:00
|
|
|
in
|
|
|
|
buildLinux (args // {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "linux-t2";
|
|
|
|
# Snippet from nixpkgs
|
2024-11-23 11:17:34 +01:00
|
|
|
modDirVersion = "${lib.concatStringsSep "." (lib.take 3 (lib.splitVersion "${version}.0"))}";
|
2022-08-25 17:17:01 +02:00
|
|
|
|
2023-12-25 22:57:09 +01:00
|
|
|
src = runCommand "patched-source" {} ''
|
2024-07-06 06:23:26 +02:00
|
|
|
cp -r ${kernel} $out
|
2023-12-25 22:57:09 +01:00
|
|
|
chmod -R u+w $out
|
|
|
|
cd $out
|
|
|
|
while read -r patch; do
|
|
|
|
echo "Applying patch $patch";
|
|
|
|
patch -p1 < $patch;
|
|
|
|
done < <(find ${patchRepo} -type f -name "*.patch" | sort)
|
|
|
|
'';
|
2022-08-25 17:17:01 +02:00
|
|
|
|
|
|
|
structuredExtraConfig = with lib.kernel; {
|
|
|
|
APPLE_BCE = module;
|
|
|
|
APPLE_GMUX = module;
|
2024-06-09 16:48:25 +02:00
|
|
|
APFS_FS = module;
|
2022-08-25 17:17:01 +02:00
|
|
|
BRCMFMAC = module;
|
|
|
|
BT_BCM = module;
|
|
|
|
BT_HCIBCM4377 = module;
|
|
|
|
BT_HCIUART_BCM = yes;
|
|
|
|
BT_HCIUART = module;
|
2024-04-12 21:53:47 +02:00
|
|
|
HID_APPLETB_BL = module;
|
|
|
|
HID_APPLETB_KBD = module;
|
2022-08-25 17:17:01 +02:00
|
|
|
HID_APPLE = module;
|
2024-04-12 21:53:47 +02:00
|
|
|
DRM_APPLETBDRM = module;
|
2022-08-25 17:17:01 +02:00
|
|
|
HID_SENSOR_ALS = module;
|
|
|
|
SND_PCM = module;
|
|
|
|
STAGING = yes;
|
|
|
|
};
|
|
|
|
|
2023-12-25 22:57:09 +01:00
|
|
|
kernelPatches = [];
|
2022-08-25 17:17:01 +02:00
|
|
|
} // (args.argsOverride or {}))
|