mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	lenovo-legion-16arh7h: add integrated GPU only and hybrid configurations
This commit is contained in:
		
				
					committed by
					
						
						mergify[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							9a049b4a42
						
					
				
				
					commit
					047799739c
				
			
							
								
								
									
										4
									
								
								lenovo/legion/16arh7h/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								lenovo/legion/16arh7h/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
# Useful Links
 | 
			
		||||
 | 
			
		||||
[NixOS Wiki - Nvidia](https://wiki.nixos.org/wiki/NVIDIA)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										32
									
								
								lenovo/legion/16arh7h/hybrid/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								lenovo/legion/16arh7h/hybrid/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
{
 | 
			
		||||
  config,
 | 
			
		||||
  lib,
 | 
			
		||||
  ...
 | 
			
		||||
}: {
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../../../../common/cpu/amd
 | 
			
		||||
    ../../../../common/cpu/amd/pstate.nix
 | 
			
		||||
    ../../../../common/gpu/nvidia/prime.nix # prime offload
 | 
			
		||||
    ../../../../common/gpu/nvidia/ampere # use open drivers
 | 
			
		||||
    ../../../../common/pc/laptop
 | 
			
		||||
    ../../../../common/pc/laptop/ssd
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  boot.kernelModules = ["amdgpu"];
 | 
			
		||||
  services.xserver.videoDrivers = ["nvidia"];
 | 
			
		||||
 | 
			
		||||
  hardware = {
 | 
			
		||||
    amdgpu.initrd.enable = false;
 | 
			
		||||
 | 
			
		||||
    nvidia = {
 | 
			
		||||
      package = config.boot.kernelPackages.nvidiaPackages.latest;
 | 
			
		||||
      modesetting.enable = lib.mkDefault true;
 | 
			
		||||
      powerManagement.enable = lib.mkDefault true;
 | 
			
		||||
      powerManagement.finegrained = lib.mkDefault true;
 | 
			
		||||
      prime = {
 | 
			
		||||
        amdgpuBusId = lib.mkDefault "PCI:52:0:0"; # Hexadecimal 34:00.0
 | 
			
		||||
        nvidiaBusId = lib.mkDefault "PCI:1:0:0"; # Hexadecimal 01:00.0
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								lenovo/legion/16arh7h/igpu-only/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								lenovo/legion/16arh7h/igpu-only/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
# This will enable only the integrated AMD GPU, while disabling the dedicated Nvidia GPU
 | 
			
		||||
{...}: {
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../../../../common/cpu/amd
 | 
			
		||||
    ../../../../common/cpu/amd/pstate.nix
 | 
			
		||||
    ../../../../common/gpu/amd
 | 
			
		||||
    ../../../../common/gpu/nvidia/disable.nix
 | 
			
		||||
    ../../../../common/pc/laptop
 | 
			
		||||
    ../../../../common/pc/laptop/ssd
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user