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

Lenovo Legion 16achg6 support #796

Merged
merged 37 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
625c4a5
Adding 16achg6
Nov 25, 2023
88c1936
Adding 16achg6 to flake.nix
Nov 25, 2023
c0ed71e
Commenting out a few things for testing
Nov 25, 2023
b927cb5
Commenting out more stuff to find the one that breaks everything.
Nov 25, 2023
20219ca
Last commit worked. Uncommenting some stuff to see if it works.
Nov 25, 2023
43e8211
Uncommenting cpu amd.
Nov 25, 2023
0380004
Uncommenting pstate.
Nov 25, 2023
b88c7a7
Uncommenting GPU AMD.
Nov 25, 2023
63638ff
Uncommenting NVidia prime.
Nov 25, 2023
813b846
Cleanup. Commenting out NVidia Prime for now
Nov 25, 2023
ea1c015
Removing non-hybrid for now.
Nov 25, 2023
9746160
Using loadInInitd
Nov 26, 2023
91e869b
Using prime.
Nov 26, 2023
5c57036
Experimenting with options.
Nov 26, 2023
6349180
Adding config to nix params.
Nov 26, 2023
de027fa
Experimenting with prime definition.
Nov 26, 2023
325f685
More experiments.
Nov 26, 2023
cee93ad
Adding NVidia-only config.
Nov 26, 2023
dd768f3
Remove redundant config options.
Nov 27, 2023
c5d3c5e
Experimenting with specialisation.
Nov 27, 2023
9fe155e
Removing external display. Moving videoDrivers here.
Dec 10, 2023
be1f533
Restoring specialisation.
Dec 10, 2023
e526ba0
Reverting videoDrivers
Dec 10, 2023
3ce3048
Restoring videoDrivers once again.
Dec 10, 2023
7b3a5ee
One more attempt at removing specialisation.
Dec 10, 2023
4704826
Merge branch 'NixOS:master' into master
bratfizyk Dec 10, 2023
854c9e6
Adding sync config
Dec 10, 2023
067ef54
Adding new config to flake.nix
Dec 10, 2023
c97cc3f
Changing to sync, not reverse.
Dec 10, 2023
8865402
Experimenting with config.
Dec 10, 2023
6bde7b0
Removing not found module.
Dec 10, 2023
02cd716
Restoring videoDrivers
Dec 10, 2023
ef2d9dc
If this works, it means it's final
Dec 10, 2023
75acfe9
Finishing touch and updating README.
Dec 10, 2023
c222753
Removing 'sync' config from flake.nix.
Dec 10, 2023
85d066d
Updating global README.
Dec 10, 2023
a744ab3
Fixed item orders.
Dec 10, 2023
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
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
lenovo-legion-16ach6h = import ./lenovo/legion/16ach6h;
lenovo-legion-16ach6h-hybrid = import ./lenovo/legion/16ach6h/hybrid;
lenovo-legion-16ach6h-nvidia = import ./lenovo/legion/16ach6h/nvidia;
lenovo-legion-16achg6-hybrid = import ./lenovo/legion/16achg6/hybrid;
Mic92 marked this conversation as resolved.
Show resolved Hide resolved
lenovo-legion-16achg6-nvidia = import ./lenovo/legion/16achg6/nvidia;
lenovo-legion-16ithg6 = import ./lenovo/legion/16ithg6;
lenovo-legion-16irx8h = import ./lenovo/legion/16irx8h;
lenovo-legion-y530-15ich = import ./lenovo/legion/15ich;
Expand Down
21 changes: 21 additions & 0 deletions lenovo/legion/16achg6/README.md
Original file line number Diff line number Diff line change
@@ -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 changes: 26 additions & 0 deletions lenovo/legion/16achg6/hybrid/default.nix
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions lenovo/legion/16achg6/nvidia/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ ... }:

{
imports = [ ../hybrid ];
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
nvidia.prime.offload.enable = false;
amdgpu = {
amdvlk = false;
opencl = false;
};
};
}