2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, kernel, bc }:
|
2021-05-19 07:50:13 +01:00
|
|
|
|
2020-06-04 15:47:20 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-19 07:50:13 +01:00
|
|
|
pname = "rtl8821cu";
|
|
|
|
version = "${kernel.version}-unstable-2021-05-19";
|
2020-06-04 15:47:20 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-19 07:50:13 +01:00
|
|
|
owner = "morrownr";
|
|
|
|
repo = "8821cu";
|
|
|
|
rev = "2430c354c9b15fa6193a263c99ce57211d50c66f";
|
|
|
|
sha256 = "sha256-PkrpwebZYh/hBukqDQf6pxfbkVyA+CpYtte5pmzgLtw=";
|
2020-06-04 15:47:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bc ];
|
|
|
|
buildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
|
|
|
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/"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-04 15:47:20 +01:00
|
|
|
description = "Realtek rtl8821cu driver";
|
2021-05-19 07:50:13 +01:00
|
|
|
homepage = "https://github.com/morrownr/8821cu";
|
|
|
|
license = licenses.gpl2Only;
|
2020-06-04 15:47:20 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.contrun ];
|
|
|
|
};
|
|
|
|
}
|