summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-11-16 02:35:53 +0100
committerGitHub <noreply@github.com>2022-11-16 02:35:53 +0100
commita0bb254735ab64192ea1eb55aac524e4d4973501 (patch)
tree56aa9be235f2b3988c4337bb38afcdd6039bc24d /pkgs/os-specific
parent8fb58087ad8fc87bdcb0b7576e5bee6e5bd31c70 (diff)
parent98edc9b2531827abd557d6455829b036354cb5ad (diff)
Merge pull request #170421 from chuangzhu/rtl8723ds
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/rtl8723ds/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/rtl8723ds/default.nix b/pkgs/os-specific/linux/rtl8723ds/default.nix
new file mode 100644
index 0000000000000..a732d1c5d8e50
--- /dev/null
+++ b/pkgs/os-specific/linux/rtl8723ds/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, kernel, bc }:
+
+stdenv.mkDerivation {
+  pname = "rtl8723ds";
+  version = "${kernel.version}-unstable-2022-10-20";
+
+  src = fetchFromGitHub {
+    owner = "lwfinger";
+    repo = "rtl8723ds";
+    rev = "912fdb30531bc8c071267a047e7df16feae7a865";
+    sha256 = "sha256-HhoCKrrRg1Q995sekQvzhaiqANeTP8pANItj2vLV+Cw=";
+  };
+
+  hardeningDisable = [ "pic" ];
+
+  nativeBuildInputs = [ bc ];
+  buildInputs = kernel.moduleBuildDependencies;
+
+  makeFlags = [
+    "ARCH=${stdenv.hostPlatform.linuxArch}"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
+  ];
+
+  postPatch = ''
+    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 = {
+    description = "Linux driver for RTL8723DS.";
+    homepage = "https://github.com/lwfinger/rtl8723ds";
+    license = lib.licenses.gpl2Only;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ chuangzhu ];
+  };
+}