mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			601 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			601 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ config, lib, pkgs, ... }:
 | 
						|
 | 
						|
with lib;
 | 
						|
 | 
						|
let
 | 
						|
 | 
						|
  bmi260 = config.boot.kernelPackages.callPackage ./package.nix { };
 | 
						|
 | 
						|
in
 | 
						|
{
 | 
						|
 | 
						|
  meta.maintainers = [ maintainers.Cryolitia ];
 | 
						|
 | 
						|
  ###### interface
 | 
						|
 | 
						|
  options = {
 | 
						|
 | 
						|
    hardware.sensor.iio.bmi260.enable = mkOption {
 | 
						|
      default = false;
 | 
						|
      type = types.bool;
 | 
						|
      description = mdDoc ''
 | 
						|
        Enable Bosch BMI260 IMU kernel module driver.
 | 
						|
      '';
 | 
						|
    };
 | 
						|
  };
 | 
						|
 | 
						|
  ###### implementation
 | 
						|
 | 
						|
  config = mkIf config.hardware.sensor.iio.bmi260.enable {
 | 
						|
    boot.extraModulePackages = [ bmi260 ];
 | 
						|
    boot.kernelModules = [ "bmi260_core" "bmi260_i2c" ];
 | 
						|
  };
 | 
						|
}
 |