1 { lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
3 stdenv.mkDerivation (finalAttrs: {
5 version = "${kernel.version}-unstable-2024-05-06";
7 src = fetchFromGitHub {
10 rev = "865ab0fa91471d595c283d2f3db323f7f15455f5";
11 hash = "sha256-c2dpnZS6a0waL1khB9ZEglTwJIBsyRebTMig1B4A0xU=";
14 nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies;
15 hardeningDisable = [ "pic" "format" ];
18 substituteInPlace ./Makefile \
19 --replace-fail /sbin/depmod \# \
20 --replace-fail '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/" \
21 --replace-fail '/usr/lib/systemd/system-sleep' "$out/usr/lib/systemd/system-sleep"
22 substituteInPlace ./platform/i386_pc.mk \
23 --replace-fail /lib/modules "${kernel.dev}/lib/modules"
27 "ARCH=${stdenv.hostPlatform.linuxArch}"
28 ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
29 ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n"))
30 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
31 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
35 mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
36 mkdir -p "$out/usr/lib/systemd/system-sleep"
40 nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
43 enableParallelBuilding = true;
46 description = "Driver for Realtek 802.11ac, rtl8852au, provides the 8852au mod";
47 homepage = "https://github.com/lwfinger/rtl8852au";
48 license = licenses.gpl2Only;
49 platforms = platforms.linux;
50 maintainers = with maintainers; [ lonyelon ];