mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			712 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			712 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ config, lib, pkgs, ... }:
 | 
						|
 | 
						|
let
 | 
						|
  inherit (lib) mkIf mkOption;
 | 
						|
 | 
						|
  inherit (pkgs.callPackage ../linux-package.nix { }) linuxPackage surfacePatches isVersionOf versionsOfEnum;
 | 
						|
 | 
						|
  cfg = config.microsoft-surface;
 | 
						|
 | 
						|
  version = "6.9.12";
 | 
						|
  kernelPatches = surfacePatches {
 | 
						|
    inherit version;
 | 
						|
    patchFn = ./patches.nix;
 | 
						|
  };
 | 
						|
  kernelPackages = linuxPackage {
 | 
						|
    inherit version kernelPatches;
 | 
						|
    sha256 = "08ngskni7d9wi93vlwcmbdg7sb2jl1drhhzn62k9nsrg1r7crrss";
 | 
						|
    ignoreConfigErrors=true;
 | 
						|
  };
 | 
						|
 | 
						|
in {
 | 
						|
  options.microsoft-surface.kernelVersion = mkOption {
 | 
						|
    type = versionsOfEnum version;
 | 
						|
  };
 | 
						|
 | 
						|
  config = mkIf (isVersionOf cfg.kernelVersion version) {
 | 
						|
    boot = {
 | 
						|
      inherit kernelPackages;
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |