mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	Added support for Lenovo Legion Slim 5 (16APH8)
Added PPD after researching the Framework laptops with AMD 7000 series
This commit is contained in:
		
							
								
								
									
										38
									
								
								lenovo/legion/16aph8/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								lenovo/legion/16aph8/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
			
		||||
I was unable to get the hybrid settings working well with lightdm or sddm, but Optimus Sync
 | 
			
		||||
mode seems to work the best for me.
 | 
			
		||||
 | 
			
		||||
I am running the Linux 6.6 LTS kernel with KDE + SDDM, and it seems to be working well.
 | 
			
		||||
 | 
			
		||||
## hardware-configuration.nix
 | 
			
		||||
 | 
			
		||||
I have the following customizations added for my nvidia drivers.
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
hardware.nvidia = {
 | 
			
		||||
    nvidiaSettings = true;
 | 
			
		||||
    package = config.boot.kernelPackages.nvidiaPackages.stable;
 | 
			
		||||
};
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Setup at the time of testing
 | 
			
		||||
 | 
			
		||||
### nix-info
 | 
			
		||||
```
 | 
			
		||||
$ nix-info -m
 | 
			
		||||
 - system: `"x86_64-linux"`
 | 
			
		||||
 - host os: `Linux 6.1.68, NixOS, 23.11 (Tapir), 23.11.20231220.d65bcea`
 | 
			
		||||
 - multi-user?: `yes`
 | 
			
		||||
 - sandbox: `yes`
 | 
			
		||||
 - version: `nix-env (Nix) 2.18.1`
 | 
			
		||||
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### lspci
 | 
			
		||||
```
 | 
			
		||||
$ lspci
 | 
			
		||||
...
 | 
			
		||||
01:00.0 VGA compatible controller: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile] (rev a1)
 | 
			
		||||
...
 | 
			
		||||
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 (rev c2)
 | 
			
		||||
...
 | 
			
		||||
```
 | 
			
		||||
							
								
								
									
										36
									
								
								lenovo/legion/16aph8/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								lenovo/legion/16aph8/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
{ lib, pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../../../common/cpu/amd
 | 
			
		||||
    ../../../common/cpu/amd/pstate.nix
 | 
			
		||||
    ../../../common/gpu/amd
 | 
			
		||||
    ../../../common/gpu/nvidia
 | 
			
		||||
    ../../../common/pc/laptop
 | 
			
		||||
    ../../../common/pc/laptop/ssd
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # Use latest LTS kernel for more Raphael fixes
 | 
			
		||||
  boot = lib.mkMerge [
 | 
			
		||||
    (lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") {
 | 
			
		||||
      kernelPackages = pkgs.linuxPackages_6_6;
 | 
			
		||||
      kernelParams = ["amdgpu.sg_display=0"];
 | 
			
		||||
    })
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  hardware.nvidia = {
 | 
			
		||||
      modesetting.enable = lib.mkDefault true;
 | 
			
		||||
      powerManagement.enable = lib.mkDefault false;
 | 
			
		||||
      powerManagement.finegrained = lib.mkDefault false;
 | 
			
		||||
      open = lib.mkDefault false;
 | 
			
		||||
      prime = {
 | 
			
		||||
          sync.enable = lib.mkDefault true;
 | 
			
		||||
          amdgpuBusId = "PCI:5:0:0";
 | 
			
		||||
          nvidiaBusId = "PCI:1:0:0";
 | 
			
		||||
      };
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # AMD has better battery life with PPD over TLP:
 | 
			
		||||
  # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
 | 
			
		||||
  services.power-profiles-daemon.enable = lib.mkDefault true;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user