Skip to content

Instantly share code, notes, and snippets.

@ppenguin
Created June 2, 2026 10:43
Show Gist options
  • Select an option

  • Save ppenguin/f5c0a5ba297162d75bb1d085a8da2827 to your computer and use it in GitHub Desktop.

Select an option

Save ppenguin/f5c0a5ba297162d75bb1d085a8da2827 to your computer and use it in GitHub Desktop.
Asahi fairydust (experimental) on NixOS-apple-silicon (M1, use front USB!!!)
{
lib,
pkgs,
config,
...
}: let
# linux-asahi at the fairydust branch (DisplayPort Alt Mode over USB-C),
# same version (7.0.10) and structuredExtraConfig as upstream linux-asahi in
# nixos-apple-silicon, only the source commit differs.
linux-fairydust = pkgs.callPackage (
{
stdenv,
lib,
fetchFromGitHub,
buildLinux,
linuxPackagesFor,
_kernelPatches ? [],
}: let
kernel = buildLinux {
inherit stdenv lib;
pname = "linux-asahi-fairydust";
version = "7.0.10";
modDirVersion = "7.0.10";
extraMeta.branch = "7.0";
src = fetchFromGitHub {
owner = "AsahiLinux";
repo = "linux";
rev = "ce3b823962dc839c5d5b0b8198f75bd8c60aeea3";
hash = "sha256-FnAY8ZiSR0NaX/qP47034A/mrBwVodWXChusX9H/hxs=";
};
kernelPatches =
[
{
name = "Asahi config";
patch = null;
structuredExtraConfig = with lib.kernel; {
ARM64_16K_PAGES = yes;
ARM64_MEMORY_MODEL_CONTROL = yes;
ARM64_ACTLR_STATE = yes;
APPLE_WATCHDOG = yes;
APPLE_M1_CPU_PMU = yes;
HID_APPLE = module;
APPLE_PMGR_MISC = yes;
APPLE_PMGR_PWRSTATE = yes;
};
features.rust = true;
}
]
++ _kernelPatches;
};
in
lib.recurseIntoAttrs (linuxPackagesFor kernel)
) {_kernelPatches = config.boot.kernelPatches;};
in {
boot = {
kernelPackages = lib.mkForce linux-fairydust;
extraModulePackages = [
config.boot.kernelPackages.evdi # DisplayLink USB display adapter support
];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment