1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-09-20 05:17:22 +02:00
nixos-hardware/apple/t2/pkgs/linux-t2.nix
Cassie Cheung 35f2177d66 apple/t2: update to kernel 6.9.3
* also updates the patches kernel to include the apfs module
2024-06-10 04:44:27 +00:00

55 lines
1.5 KiB
Nix

{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand
, ... } @ args:
let
patchRepo = fetchFromGitHub {
owner = "t2linux";
repo = "linux-t2-patches";
rev = "33d5a01c41f140a416a7f840cc06e7f30dc58d8d";
hash = "sha256-wx5jkOQ8l/4XRGLV9KFrxXuqunwcFA9RB1yhrtseP2A=";
};
version = "6.9.3";
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"))}";
src = runCommand "patched-source" {} ''
cp -r ${fetchzip {
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
hash = "sha256-7262WHO2veIn+9cd4m9io1ov93LsfpgRKfmvBx0DCBA=";
}} $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)
'';
structuredExtraConfig = with lib.kernel; {
APPLE_BCE = module;
APPLE_GMUX = module;
APFS_FS = module;
BRCMFMAC = module;
BT_BCM = module;
BT_HCIBCM4377 = module;
BT_HCIUART_BCM = yes;
BT_HCIUART = module;
HID_APPLETB_BL = module;
HID_APPLETB_KBD = module;
HID_APPLE = module;
DRM_APPLETBDRM = module;
HID_APPLE_MAGIC_BACKLIGHT = module;
HID_SENSOR_ALS = module;
SND_PCM = module;
STAGING = yes;
};
kernelPatches = [];
} // (args.argsOverride or {}))