Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hardware support for Lenovo LOQ 15aph8 #1206

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ See code for all available configurations.
| [Lenovo Legion Slim 7 Gen 7 (AMD)](lenovo/legion/16arha7/) | `<nixos-hardware/lenovo/legion/16arha7>` |
| [Lenovo Legion T5 AMR5](lenovo/legion/t526amr5) | `<nixos-hardware/lenovo/legion/t526amr5>` |
| [Lenovo Legion Y530 15ICH](lenovo/legion/15ich) | `<nixos-hardware/lenovo/legion/15ich>` |
| [Lenovo LOQ 15APH8 (lenovo/loq/15aph8) | `<nixos-hardware/lenovo/loq/15aph8>` |
| [Lenovo ThinkPad A475](lenovo/thinkpad/a475) | `<nixos-hardware/lenovo/thinkpad/a475>` |
| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `<nixos-hardware/lenovo/thinkpad/e14/amd>` |
| [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `<nixos-hardware/lenovo/thinkpad/e14/intel>` |
Expand Down Expand Up @@ -335,7 +336,7 @@ See code for all available configurations.
| [System76 (generic)](system76) | `<nixos-hardware/system76>` |
| [System76 Darter Pro 6](system76/darp6) | `<nixos-hardware/system76/darp6>` |
| [System76 Gazelle 18](system76/gaze18) | `<nixos-hardware/system76/gaze18>` |
| [System76 Galago Pro 5](system76/galp5-1650) | `<nixos-hardware/system76/galp5-1650>` |
| [System76 Galago Pro 5](system76/galp5-1650) | `<nixos-hardware/system76/galp5-1650>` |
| [Toshiba Chromebook 2 `swanky`](toshiba/swanky) | `<nixos-hardware/toshiba/swanky>` |
| [Tuxedo InfinityBook v4](tuxedo/infinitybook/v4) | `<nixos-hardware/tuxedo/infinitybook/v4>` |
| [TUXEDO Aura 15 - Gen1](tuxedo/aura/15/gen1) | `<nixos-hardware/tuxedo/aura/15/gen1>` |
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h;
lenovo-legion-t526amr5 = import ./lenovo/legion/t526amr5;
lenovo-legion-y530-15ich = import ./lenovo/legion/15ich;
lenovo-loq-15aph8 = import ./lenovo/loq/15aph8;
lenovo-thinkpad = import ./lenovo/thinkpad;
lenovo-thinkpad-a475 = import ./lenovo/thinkpad/a475;
lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd;
Expand Down
15 changes: 15 additions & 0 deletions lenovo/loq/15aph8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Lenovo LOQ 15APH8

Tested on LOQ 15APH8 (82XT) with:
- AMD Phoenix GPU
- NVIDIA GeForce RTX 4050 Max-Q
- AMD Phoenix1 integrated graphics

## Features Requiring Configuration
For optimal power management, consider adding:

```nix
services.power-profiles-daemon.enable = true;
powerManagement.powertop.enable = true;
```

28 changes: 28 additions & 0 deletions lenovo/loq/15aph8/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ lib, ...}: {
imports = [
../../../common/cpu/amd
../../../common/gpu/nvidia/prime.nix
../../../common/gpu/nvidia/ada-lovelace
../../../common/pc/laptop
../../../common/pc/laptop/ssd
];

hardware.nvidia.prime = {
amdgpuBusId = lib.mkDefault "PCI:5:0:0";
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
};

# Power management - using mkDefault as these can be overridden
hardware.nvidia.powerManagement.enable = lib.mkDefault true;
hardware.nvidia.modesetting.enable = lib.mkDefault true;
services.thermald.enable = lib.mkDefault true;

# These will merge with user settings, so no mkDefault needed
boot.kernelModules = [ "kvm-amd" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nixos-generate-config already does this:

Suggested change
boot.kernelModules = [ "kvm-amd" ];

boot.initrd.kernelModules = [ "amdgpu" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
boot.initrd.kernelModules = [ "amdgpu" ];
hardware.amdgpu.initrd.enable = true;


# Essential kernel parameters for AMD CPU
boot.kernelParams = [ "amd_pstate=active" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be replaced by an import:

../../../common/cpu/amd/pstate.nix

}