{ lib , stdenv , fetchFromGitHub , kernel }: stdenv.mkDerivation rec { pname = "nct6687d"; version = "unstable-2023-09-22"; src = fetchFromGitHub { owner = "Fred78290"; repo = "nct6687d"; rev = "cdfe855342a9383a9c4c918d51576c36d989070d"; hash = "sha256-iOLWxj4I6oYkNXFSkmw7meTQEnrIfb4Mw+/LkzgzDxM="; }; setSourceRoot = '' export sourceRoot=$(pwd)/source ''; nativeBuildInputs = kernel.moduleBuildDependencies; makeFlags = kernel.makeFlags ++ [ "-C" "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "M=$(sourceRoot)" ]; buildFlags = [ "modules" ]; installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ]; installTargets = [ "modules_install" ]; meta = with lib; { description = "Kernel module for the Nuvoton NCT6687-R chipset found on many B550/B650 motherboards from ASUS and MSI"; license = with licenses; [ gpl2Only ]; homepage = "https://github.com/Fred78290/nct6687d/"; platforms = platforms.linux; maintainers = with maintainers; [ atemu ]; }; }