mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	The previous implementation was checking the kernel version through `pkgs.linux`, which is only representative of the final system if `boot.kernelPackages` is left as the default value of `pkgs.linuxPackages`. You can of course change this to other package sets, such as `pkgs.linuxPackages_latest`. Instead, we now reference the kernel through `config.boot.kernelPackages.kernel`.
		
			
				
	
	
		
			23 lines
		
	
	
		
			491 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			491 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ config, lib, ... }:
 | 
						|
 | 
						|
{
 | 
						|
  imports = [
 | 
						|
    ../../common/cpu/amd
 | 
						|
    ../../common/cpu/amd/pstate.nix
 | 
						|
    ../../common/gpu/nvidia/prime.nix
 | 
						|
    ../../common/gpu/nvidia/ampere
 | 
						|
    ../../common/pc/laptop
 | 
						|
    ../../common/pc/ssd
 | 
						|
  ];
 | 
						|
 | 
						|
  # Enables ACPI platform profiles
 | 
						|
  boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.1") {
 | 
						|
    kernelModules = [ "hp-wmi" ];
 | 
						|
  };
 | 
						|
 | 
						|
  hardware.nvidia.prime = {
 | 
						|
    amdgpuBusId = "PCI:6:0:0";
 | 
						|
    nvidiaBusId = "PCI:1:0:0";
 | 
						|
  };
 | 
						|
}
 |