nixpkgs-suyu/pkgs/os-specific/linux/rtl8821ce/default.nix

39 lines
1.1 KiB
Nix

{ lib, stdenv, fetchFromGitHub, kernel, bc }:
stdenv.mkDerivation rec {
pname = "rtl8821ce";
version = "${kernel.version}-unstable-2021-05-28";
src = fetchFromGitHub {
owner = "tomaspinho";
repo = "rtl8821ce";
rev = "f93db734666f75ebf65e44ceb943c19b598b1647";
sha256 = "sha256-cqXV52U+6Jl9Jje1nEOYDvmH4rgA1QdrwNCfYeul3hU=";
};
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/"
'';
meta = with lib; {
description = "Realtek rtl8821ce driver";
homepage = "https://github.com/tomaspinho/rtl8821ce";
license = licenses.gpl2Only;
platforms = platforms.linux;
broken = stdenv.isAarch64;
maintainers = with maintainers; [ hhm ];
};
}