mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	gpd-win-max-2-2023: init BMI260 driver
This commit is contained in:
		
							
								
								
									
										42
									
								
								gpd/win-max-2/2023/bmi260/package.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								gpd/win-max-2/2023/bmi260/package.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
{ lib
 | 
			
		||||
, stdenv
 | 
			
		||||
, fetchFromGitHub
 | 
			
		||||
, fetchurl
 | 
			
		||||
, kernel
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
stdenv.mkDerivation (finalAttr: {
 | 
			
		||||
  pname = "bmi260";
 | 
			
		||||
  version = "0.0.2";
 | 
			
		||||
 | 
			
		||||
  src = fetchFromGitHub {
 | 
			
		||||
    owner = "hhd-dev";
 | 
			
		||||
    repo = finalAttr.pname;
 | 
			
		||||
    rev = "v${finalAttr.version}";
 | 
			
		||||
    hash = "sha256-J0npD75QqOGY1QUoznBjQ+jX28gq5u6b0JZOseclwE8=";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  hardeningDisable = [ "pic" ];
 | 
			
		||||
 | 
			
		||||
  nativeBuildInputs = kernel.moduleBuildDependencies;
 | 
			
		||||
 | 
			
		||||
  makeFlags = [
 | 
			
		||||
    "KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  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";
 | 
			
		||||
    description = "A kernel module driver for the Bosch BMI260 IMU";
 | 
			
		||||
    license = with licenses; [ bsd3 gpl2Only ];
 | 
			
		||||
    maintainers = with maintainers; [ Cryolitia ];
 | 
			
		||||
    platforms = platforms.linux;
 | 
			
		||||
  };
 | 
			
		||||
})
 | 
			
		||||
		Reference in New Issue
	
	Block a user