1 { lib, stdenv, fetchFromGitHub, kernel, bc, nukeReferences }:
5 version = "${kernel.version}-unstable-2024-03-16";
7 src = fetchFromGitHub {
9 repo = "8821au-20210708";
10 rev = "168ac48174067e17ffb9f8b15ab802f37447dacc";
11 hash = "sha256-eB9RCoU5jg5fgZkfcef9fsQ6tyD8gTPD+wYcR6PbWNw=";
14 nativeBuildInputs = [ bc nukeReferences ] ++ kernel.moduleBuildDependencies;
16 hardeningDisable = [ "pic" "format" ];
18 env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
21 "ARCH=${stdenv.hostPlatform.linuxArch}"
22 ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n"))
23 ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
24 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
25 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
29 substituteInPlace ./Makefile \
30 --replace /lib/modules/ "${kernel.dev}/lib/modules/" \
31 --replace /sbin/depmod \# \
32 --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
36 mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
40 nuke-refs $out/lib/modules/*/kernel/net/wireless/*.ko
43 enableParallelBuilding = true;
46 description = "rtl8821AU and rtl8812AU chipset driver with firmware";
47 homepage = "https://github.com/morrownr/8821au";
48 license = licenses.gpl2Only;
49 platforms = lib.platforms.linux;
50 maintainers = with maintainers; [ plchldr ];