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

feat: add legion 16ahp9 #1408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
lenovo-legion-16ach6h-nvidia = import ./lenovo/legion/16ach6h/nvidia;
lenovo-legion-16achg6-hybrid = import ./lenovo/legion/16achg6/hybrid;
lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia;
lenovo-legion-16ahp9 = import ./lenovo/legion/16ahp9;
Copy link
Member

Choose a reason for hiding this comment

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

Please also add this profile to the README.md table.

lenovo-legion-16aph8 = import ./lenovo/legion/16aph8;
lenovo-legion-16arha7 = import ./lenovo/legion/16arha7;
lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6;
Expand Down
15 changes: 15 additions & 0 deletions lenovo/legion/16ahp9/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
I am running the Linux 6.12.17 kernel with Gnome, and it seems to be working well.

## Setup at the time of testing

### nix-info

```
$ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 6.12.17, NixOS, 25.05 (Warbler), 25.05.20250309.e3e32b6`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.24.12`
- nixpkgs: `/nix/store/g4ppspdl4fy7hnp4jgjl4ll03v7i08w3-source`
```
39 changes: 39 additions & 0 deletions lenovo/legion/16ahp9/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ 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_latest;
kernelParams = [ "amdgpu.sg_display=0" ];
Copy link
Member

Choose a reason for hiding this comment

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

In NixOS unstable we have linux 6.12 now by default. Shouldn't be in that case this also exported?

})
];

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:6:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};

# Avoid issues with modesetting causing blank screen
services.xserver.videoDrivers = [ "nvidia" ];

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