2024-10-13 02:10:23 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
kernel,
|
2024-02-11 07:46:44 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttr: {
|
|
|
|
pname = "bmi260";
|
2024-10-13 02:10:23 +02:00
|
|
|
version = "1.0.0";
|
2024-02-11 07:46:44 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hhd-dev";
|
|
|
|
repo = finalAttr.pname;
|
|
|
|
rev = "v${finalAttr.version}";
|
2024-10-13 02:10:23 +02:00
|
|
|
hash = "sha256-EFous0pPpCuVoCsFz6/4NryQRSH9Jw9Qng+RY1hiX1c=";
|
2024-02-11 07:46:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "pic" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
|
2024-10-13 02:10:23 +02:00
|
|
|
makeFlags = [ "KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
|
2024-02-11 07:46:44 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install *.ko -Dm444 -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/bmi260
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/hhd-dev/bmi260";
|
2024-10-13 02:10:23 +02:00
|
|
|
description = "A kernel driver for the Bosch BMI260 IMU";
|
|
|
|
license = with licenses; [
|
|
|
|
bsd3
|
|
|
|
gpl2Only
|
|
|
|
];
|
2024-02-11 07:46:44 +01:00
|
|
|
maintainers = with maintainers; [ Cryolitia ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
})
|