mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-05 09:38:07 +08:00
apple-t2: avoid import-from-derivation
This commit is contained in:
committed by
mergify[bot]
parent
65753f5d11
commit
a15b6e525f
@@ -1,4 +1,5 @@
|
||||
{ lib, buildLinux, fetchFromGitHub, fetchurl, ... } @ args:
|
||||
{ lib, buildLinux, fetchFromGitHub, fetchzip, runCommand
|
||||
, ... } @ args:
|
||||
|
||||
let
|
||||
patchRepo = fetchFromGitHub {
|
||||
@@ -18,10 +19,18 @@ buildLinux (args // {
|
||||
# Snippet from nixpkgs
|
||||
modDirVersion = with lib; "${concatStringsSep "." (take 3 (splitVersion "${version}.0"))}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/v${majorVersion}.x/linux-${version}.tar.xz";
|
||||
hash = "sha256-eldLvCCALqdrUsp/rwcmf3IEXoYbGJFcUnKpjCer+IQ=";
|
||||
};
|
||||
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)
|
||||
'';
|
||||
|
||||
structuredExtraConfig = with lib.kernel; {
|
||||
APPLE_BCE = module;
|
||||
@@ -40,7 +49,5 @@ buildLinux (args // {
|
||||
STAGING = yes;
|
||||
};
|
||||
|
||||
kernelPatches = lib.attrsets.mapAttrsToList (file: type: { name = file; patch = "${patchRepo}/${file}"; })
|
||||
(lib.attrsets.filterAttrs (file: type: type == "regular" && lib.strings.hasSuffix ".patch" file)
|
||||
(builtins.readDir patchRepo));
|
||||
kernelPatches = [];
|
||||
} // (args.argsOverride or {}))
|
||||
|
||||
Reference in New Issue
Block a user