vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / os-specific / linux / rtl8821ce / default.nix
blob67046b28c9abb270313bbe1f8e9c632bdf100a42
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   kernel,
6   bc,
7 }:
9 stdenv.mkDerivation (finalAttrs: {
10   pname = "rtl8821ce";
11   version = "${kernel.version}-unstable-2024-03-26";
13   src = fetchFromGitHub {
14     owner = "tomaspinho";
15     repo = "rtl8821ce";
16     rev = "f119398d868b1a3395f40c1df2e08b57b2c882cd";
17     hash = "sha256-EfpKa5ZRBVM5T8EVim3cVX1PP1UM9CyG6tN5Br8zYww=";
18   };
20   hardeningDisable = [ "pic" ];
22   nativeBuildInputs = [ bc ] ++ kernel.moduleBuildDependencies;
23   makeFlags = kernel.makeFlags;
25   prePatch = ''
26     substituteInPlace ./Makefile \
27       --replace /lib/modules/ "${kernel.dev}/lib/modules/" \
28       --replace /sbin/depmod \# \
29       --replace '$(MODDESTDIR)' "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
30   '';
32   preInstall = ''
33     mkdir -p "$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
34   '';
36   enableParallelBuilding = true;
38   meta = {
39     description = "Realtek rtl8821ce driver";
40     homepage = "https://github.com/tomaspinho/rtl8821ce";
41     license = lib.licenses.gpl2Only;
42     platforms = lib.platforms.linux;
43     maintainers = with lib.maintainers; [
44       hhm
45       defelo
46     ];
47     broken =
48       stdenv.hostPlatform.isAarch64
49       || ((lib.versions.majorMinor kernel.version) == "5.4" && kernel.isHardened);
50   };