{ lib, stdenv, fetchFromGitHub, kernel }: stdenv.mkDerivation rec { pname = "sunxi-cedar"; version = "8bfe1150ea24537523465a77df56cd78076cda4a"; src = fetchFromGitHub { owner = "uboborov"; repo = "sunxi-cedar-mainline"; rev = "${version}"; sha256 = "s/Cxr1GlmvORBvoJvU0LCpezacuQv5qT/9GyJYcAtq4="; }; preConfigure = '' # forgive my laziness... add an install target to Makefile echo "install:" >> Makefile echo " $MAKE -C $KERNEL_SOURCE M=$PWD install" >> Makefile ''; # For "Makefile" makeFlags = [ "ARCH=arm" "KERNEL_SOURCE=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "CROSS_COMPILE=armv7l-unknown-linux-gnueabihf-" "INSTALL_MOD_PATH=$(out)" ]; nativeBuildInputs = kernel.moduleBuildDependencies; hardeningDisable = [ "pic" ]; meta = with lib; { description = "sunxi cedar kernel module - device: /dev/cedar_dev - targeting mainline kernel - linux-4.11.y and higher "; homepage = "https://github.com/uboborov/sunxi-cedar-mainline"; platforms = platforms.linux; license = licenses.gpl2Plus; }; }