1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-24 02:29:44 +01:00

apple/t2: factor out kernel definition for improved readability

This commit is contained in:
Cassie Cheung 2024-07-06 12:23:26 +08:00 committed by mergify[bot]
parent 6e253f12b1
commit f75ab8b22c

View file

@ -2,6 +2,9 @@
, ... } @ args:
let
version = "6.9.4";
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
patchRepo = fetchFromGitHub {
owner = "t2linux";
repo = "linux-t2-patches";
@ -9,8 +12,10 @@ let
hash = "sha256-mwT4cuIBrz3tz8+fAxVKmnRtkPRp3lWmNbocuXCsm44=";
};
version = "6.9.4";
majorVersion = with lib; (elemAt (take 1 (splitVersion version)) 0);
kernel = fetchzip {
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
hash = "sha256-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg=";
};
in
buildLinux (args // {
inherit version;
@ -20,10 +25,7 @@ buildLinux (args // {
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-8jC5DpPi6poig1gmJPIIZ2HMwQQt1kTK4PcvyYm+Hsg=";
}} $out
cp -r ${kernel} $out
chmod -R u+w $out
cd $out
while read -r patch; do