2026-06-03 20:34:44 +01:00

65 lines
1.4 KiB
Nix

{
lib,
callPackage,
linuxPackagesFor,
_kernelPatches ? [ ],
}:
let
linux-asahi-pkg =
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
buildLinux,
...
}:
buildLinux rec {
inherit stdenv lib;
pname = "linux-asahi";
version = "7.0.8";
modDirVersion = version;
extraMeta.branch = "7.0";
src = fetchFromGitHub {
owner = "AsahiLinux";
repo = "linux";
tag = "asahi-7.0.8-1";
hash = "sha256-ak1dckvTxiR09xMf4xFb6qOPiAQNgIR18v8WLtQBnWQ=";
};
kernelPatches = [
{
name = "Asahi config";
patch = null;
structuredExtraConfig = with lib.kernel; {
# Needed for GPU
ARM64_16K_PAGES = yes;
ARM64_MEMORY_MODEL_CONTROL = yes;
ARM64_ACTLR_STATE = yes;
# Might lead to the machine rebooting if not loaded soon enough
APPLE_WATCHDOG = yes;
# Can not be built as a module, defaults to no
APPLE_M1_CPU_PMU = yes;
# Defaults to 'y', but we want to allow the user to set options in modprobe.d
HID_APPLE = module;
APPLE_PMGR_MISC = yes;
APPLE_PMGR_PWRSTATE = yes;
};
features.rust = true;
}
]
++ _kernelPatches;
};
linux-asahi = callPackage linux-asahi-pkg { };
in
lib.recurseIntoAttrs (linuxPackagesFor linux-asahi)