mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	Lenovo Legion 16achg6 support (#796)
This commit is contained in:
		
							
								
								
									
										21
									
								
								lenovo/legion/16achg6/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								lenovo/legion/16achg6/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
I personally use my laptop with an external display attached. In `hybrid` config it works nice only with Wayland, while X11 can't detect the external monitor. Everything works as expected in `nvidia` mode, but battery life is reduced then.
 | 
			
		||||
 | 
			
		||||
## Setup at the time of testing
 | 
			
		||||
```
 | 
			
		||||
$ nix-info -m
 | 
			
		||||
 - system: `"x86_64-linux"`
 | 
			
		||||
 - host os: `Linux 6.1.62, NixOS, 23.05 (Stoat), 23.05.20231116.9fb1225`
 | 
			
		||||
 - multi-user?: `yes`
 | 
			
		||||
 - sandbox: `yes`
 | 
			
		||||
 - version: `nix-env (Nix) 2.13.6`
 | 
			
		||||
 - channels(beko): `"home-manager-23.05.tar.gz"`
 | 
			
		||||
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
 | 
			
		||||
 ```
 | 
			
		||||
 ```
 | 
			
		||||
 $ lspci
 | 
			
		||||
...
 | 
			
		||||
01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] (rev a1)
 | 
			
		||||
...
 | 
			
		||||
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c5)
 | 
			
		||||
...
 | 
			
		||||
```
 | 
			
		||||
							
								
								
									
										26
									
								
								lenovo/legion/16achg6/hybrid/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								lenovo/legion/16achg6/hybrid/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
{ lib, config, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../../../../common/cpu/amd
 | 
			
		||||
    ../../../../common/cpu/amd/pstate.nix
 | 
			
		||||
    ../../../../common/gpu/amd
 | 
			
		||||
    ../../../../common/gpu/nvidia/prime.nix
 | 
			
		||||
    ../../../../common/pc/laptop
 | 
			
		||||
    ../../../../common/pc/laptop/ssd
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  services.xserver.videoDrivers = [ "nvidia" "amdgpu" ];
 | 
			
		||||
 | 
			
		||||
  hardware = {
 | 
			
		||||
    nvidia = {
 | 
			
		||||
      modesetting.enable = lib.mkDefault true;
 | 
			
		||||
      powerManagement.enable = lib.mkDefault true;
 | 
			
		||||
 | 
			
		||||
      prime = {
 | 
			
		||||
        amdgpuBusId = "PCI:5:0:0";
 | 
			
		||||
        nvidiaBusId = "PCI:1:0:0";
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										13
									
								
								lenovo/legion/16achg6/nvidia/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								lenovo/legion/16achg6/nvidia/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
{ ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [ ../hybrid ];
 | 
			
		||||
  services.xserver.videoDrivers = [ "nvidia" ];
 | 
			
		||||
  hardware = {
 | 
			
		||||
    nvidia.prime.offload.enable = false;
 | 
			
		||||
    amdgpu = {
 | 
			
		||||
      amdvlk = false;
 | 
			
		||||
      opencl = false;
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user