1 { stdenv, lib, fetchzip, kernel }:
3 stdenv.mkDerivation rec {
8 name = "CH9344SER_LINUX.zip";
9 url = "https://www.wch.cn/downloads/file/386.html#CH9344SER_LINUX.zip";
10 hash = "sha256-YKNMYpap7CjhgTIpd/M9+nB11NtpwGYT/P14J6q3XZg=";
14 ./fix-incompatible-pointer-types.patch
17 sourceRoot = "${src.name}/driver";
18 hardeningDisable = [ "pic" ];
19 nativeBuildInputs = kernel.moduleBuildDependencies;
22 substituteInPlace Makefile --replace "KERNELDIR :=" "KERNELDIR ?="
26 "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
31 install -D ch9344.ko $out/lib/modules/${kernel.modDirVersion}/usb/serial/ch9344.ko
36 homepage = "https://www.wch-ic.com/";
37 downloadPage = "https://www.wch.cn/downloads/CH9344SER_LINUX_ZIP.html";
38 description = "WCH CH9344/CH348 UART driver";
40 A kernel module for WinChipHead CH9344/CH348 USB To Multi Serial Ports controller.
42 # Archive contains no license.
43 license = licenses.unfree;
44 platforms = platforms.linux;
45 maintainers = with maintainers; [ MakiseKurisu ];