2023-12-25 21:57:09 +00:00
|
|
|
{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand
|
|
|
|
, ... } @ args:
|
2022-08-25 15:17:01 +00:00
|
|
|
|
|
|
|
let
|
2024-08-02 07:56:38 +00:00
|
|
|
version = "6.10.3";
|
2024-07-06 04:23:26 +00:00
|
|
|
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
|
|
|
|
|
2022-08-25 15:17:01 +00:00
|
|
|
patchRepo = fetchFromGitHub {
|
|
|
|
owner = "t2linux";
|
|
|
|
repo = "linux-t2-patches";
|
2024-08-02 07:56:38 +00:00
|
|
|
rev = "29d6f013088303623cd9f2c6f5951eb3455830a6";
|
|
|
|
hash = "sha256-V0dakKRPC6Hj1I+SCiZXOCwtS0mZCCAsWnGtJnFlzxU=";
|
2022-08-25 15:17:01 +00:00
|
|
|
};
|
|
|
|
|
2024-07-06 04:23:26 +00:00
|
|
|
kernel = fetchzip {
|
|
|
|
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
2024-08-02 07:56:38 +00:00
|
|
|
hash = "sha256-+tWXv9j5bUJN7kzFZxuL+wB1fBCyXbtyms3Q5/dTtK4=";
|
2024-07-06 04:23:26 +00:00
|
|
|
};
|
2022-08-25 15:17:01 +00:00
|
|
|
in
|
|
|
|
buildLinux (args // {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "linux-t2";
|
|
|
|
# Snippet from nixpkgs
|
|
|
|
modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}";
|
|
|
|
|
2023-12-25 21:57:09 +00:00
|
|
|
src = runCommand "patched-source" {} ''
|
2024-07-06 04:23:26 +00:00
|
|
|
cp -r ${kernel} $out
|
2023-12-25 21:57:09 +00: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 15:17:01 +00:00
|
|
|
|
|
|
|
structuredExtraConfig = with lib.kernel; {
|
|
|
|
APPLE_BCE = module;
|
|
|
|
APPLE_GMUX = module;
|
2024-06-09 14:48:25 +00:00
|
|
|
APFS_FS = module;
|
2022-08-25 15:17:01 +00:00
|
|
|
BRCMFMAC = module;
|
|
|
|
BT_BCM = module;
|
|
|
|
BT_HCIBCM4377 = module;
|
|
|
|
BT_HCIUART_BCM = yes;
|
|
|
|
BT_HCIUART = module;
|
2024-04-12 19:53:47 +00:00
|
|
|
HID_APPLETB_BL = module;
|
|
|
|
HID_APPLETB_KBD = module;
|
2022-08-25 15:17:01 +00:00
|
|
|
HID_APPLE = module;
|
2024-04-12 19:53:47 +00:00
|
|
|
DRM_APPLETBDRM = module;
|
2022-08-25 15:17:01 +00:00
|
|
|
HID_SENSOR_ALS = module;
|
|
|
|
SND_PCM = module;
|
|
|
|
STAGING = yes;
|
|
|
|
};
|
|
|
|
|
2023-12-25 21:57:09 +00:00
|
|
|
kernelPatches = [];
|
2022-08-25 15:17:01 +00:00
|
|
|
} // (args.argsOverride or {}))
|