depot/third_party/nixpkgs/pkgs/os-specific/linux/rtw88/default.nix
Default email c7f94ff3ce Project import generated by Copybara.
GitOrigin-RevId: b85ed9dcbf187b909ef7964774f8847d554fab3b
2023-08-22 22:05:09 +02:00

41 lines
1.2 KiB
Nix

{ stdenv, lib, fetchFromGitHub, kernel }:
let
modDestDir = "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/net/wireless/realtek/rtw88";
in
stdenv.mkDerivation {
pname = "rtw88";
version = "unstable-2023-07-23";
src = fetchFromGitHub {
owner = "lwfinger";
repo = "rtw88";
rev = "9b6fe04a741a6b0a1edc5ca134927784bff033a5";
hash = "sha256-OzaIy+WTrljwAhC73wEIRUXrkz1NrGNJAS3zofQyV6E=";
};
nativeBuildInputs = kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags ++ [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
mkdir -p ${modDestDir}
find . -name '*.ko' -exec cp --parents {} ${modDestDir} \;
find ${modDestDir} -name '*.ko' -exec xz -f {} \;
runHook postInstall
'';
meta = with lib; {
description = "Backport of the latest Realtek RTW88 driver from wireless-next for older kernels";
homepage = "https://github.com/lwfinger/rtw88";
license = with licenses; [ bsd3 gpl2Only ];
maintainers = with maintainers; [ tvorog atila ];
platforms = platforms.linux;
broken = kernel.kernelOlder "4.20";
priority = -1;
};
}