lenovo-legion-16arh7h: add integrated GPU only and hybrid configurations

This commit is contained in:
QuietSeeker
2025-04-11 17:00:57 +01:00
committed by mergify[bot]
parent 9a049b4a42
commit 047799739c
5 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# Useful Links
[NixOS Wiki - Nvidia](https://wiki.nixos.org/wiki/NVIDIA)

View 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
};
};
};
}

View 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
];
}