nixpkgs/pkgs/os-specific/linux/rtl8821cu/default.nix
2022-06-12 21:59:23 +08:00

41 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, kernel, bc }:
stdenv.mkDerivation rec {
pname = "rtl8821cu";
version = "${kernel.version}-unstable-2022-05-07";
src = fetchFromGitHub {
owner = "morrownr";
repo = "8821cu-20210118";
rev = "e3cf788e1dddaba3273190755ce424f93fe593e4";
hash = "sha256-VUZU/oFSaxewy/BF/2k4OssAi4AWSWweqXYZPHmsQvY=";
};
hardeningDisable = [ "pic" ];
nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
makeFlags = kernel.makeFlags;
prePatch = ''
substituteInPlace ./Makefile \
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
--replace '$(shell uname -r)' "${kernel.modDirVersion}" \
--replace /sbin/depmod \# \
--replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
'';
preInstall = ''
mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Realtek rtl8821cu driver";
homepage = "https://github.com/morrownr/8821cu";
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = [ maintainers.contrun ];
};
}