2023-12-25 22:57:09 +01:00
|
|
|
{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand
|
|
|
|
, ... } @ args:
|
2022-08-25 17:17:01 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
patchRepo = fetchFromGitHub {
|
|
|
|
owner = "t2linux";
|
|
|
|
repo = "linux-t2-patches";
|
2023-09-01 19:18:27 +02:00
|
|
|
rev = "46dd873d1d9d12b26916790045008a91a95d0c11";
|
|
|
|
hash = "sha256-YGUGuzsAJFtZYjIW9d2XU4eGKNvMKCaWXqgqJn5TdeY=";
|
2022-08-25 17:17:01 +02:00
|
|
|
};
|
|
|
|
|
2023-09-01 19:18:27 +02:00
|
|
|
version = "6.5";
|
2022-08-25 17:17:01 +02:00
|
|
|
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
|
|
|
|
in
|
|
|
|
buildLinux (args // {
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
pname = "linux-t2";
|
|
|
|
# Snippet from nixpkgs
|
|
|
|
modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}";
|
|
|
|
|
2023-12-25 22:57:09 +01:00
|
|
|
src = runCommand "patched-source" {} ''
|
|
|
|
cp -r ${fetchzip {
|
|
|
|
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
|
|
|
hash = "sha256-qJmVSju69WcvDIbgrbtMyCi+OXUNTzNX2G+/0zwsPR4=";
|
|
|
|
}} $out
|
|
|
|
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;
|
|
|
|
BRCMFMAC = module;
|
|
|
|
BT_BCM = module;
|
|
|
|
BT_HCIBCM4377 = module;
|
|
|
|
BT_HCIUART_BCM = yes;
|
|
|
|
BT_HCIUART = module;
|
|
|
|
HID_APPLE_IBRIDGE = module;
|
|
|
|
HID_APPLE = module;
|
|
|
|
HID_APPLE_MAGIC_BACKLIGHT = module;
|
|
|
|
HID_APPLE_TOUCHBAR = module;
|
|
|
|
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 {}))
|