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 P14s, T14 updates #933

Merged
merged 9 commits into from
May 19, 2024
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ See code for all available configurations.
| [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `<nixos-hardware/lenovo/thinkpad/l14/intel>` |
| [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `<nixos-hardware/lenovo/thinkpad/l480>` |
| [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `<nixos-hardware/lenovo/thinkpad/p1/3th-gen>` |
| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen1>` |
| [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen2>` |
| [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen3>` |
| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/p14s/amd/gen4>` |
| [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/p16s/amd/gen1>` |
| [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `<nixos-hardware/lenovo/thinkpad/p1>` |
| [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `<nixos-hardware/lenovo/thinkpad/p50>` |
Expand All @@ -202,6 +205,7 @@ See code for all available configurations.
| [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen1>` |
| [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen2>` |
| [Lenovo ThinkPad T14 AMD Gen 3](lenovo/thinkpad/t14/amd/gen3) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen3>` |
| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `<nixos-hardware/lenovo/thinkpad/t14/amd/gen4>` |
| [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `<nixos-hardware/lenovo/thinkpad/t14>` |
| [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `<nixos-hardware/lenovo/thinkpad/t14s/amd/gen1>` |
| [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `<nixos-hardware/lenovo/thinkpad/t14s>` |
Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@
lenovo-thinkpad-l480 = import ./lenovo/thinkpad/l480;
lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1;
lenovo-thinkpad-p1-gen3 = import ./lenovo/thinkpad/p1/3th-gen;
lenovo-thinkpad-p14s-amd-gen1 = import ./lenovo/thinkpad/p14s/amd/gen1;
lenovo-thinkpad-p14s-amd-gen2 = import ./lenovo/thinkpad/p14s/amd/gen2;
lenovo-thinkpad-p14s-amd-gen3 = import ./lenovo/thinkpad/p14s/amd/gen3;
lenovo-thinkpad-p14s-amd-gen4 = import ./lenovo/thinkpad/p14s/amd/gen4;
lenovo-thinkpad-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1;
lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50;
lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51;
Expand All @@ -138,6 +141,7 @@
lenovo-thinkpad-t14-amd-gen1 = import ./lenovo/thinkpad/t14/amd/gen1;
lenovo-thinkpad-t14-amd-gen2 = import ./lenovo/thinkpad/t14/amd/gen2;
lenovo-thinkpad-t14-amd-gen3 = import ./lenovo/thinkpad/t14/amd/gen3;
lenovo-thinkpad-t14-amd-gen4 = import ./lenovo/thinkpad/t14/amd/gen4;
lenovo-thinkpad-t14s = import ./lenovo/thinkpad/t14s;
lenovo-thinkpad-t14s-amd-gen1 = import ./lenovo/thinkpad/t14s/amd/gen1;
lenovo-thinkpad-t410 = import ./lenovo/thinkpad/t410;
Expand Down
12 changes: 12 additions & 0 deletions lenovo/thinkpad/p14s/amd/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ lib, pkgs, ... }:

{
imports = [
../.
../../../../common/cpu/amd
../../../../common/gpu/amd
];

# For support of newer AMD GPUs, backlight and internal microphone
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.8") pkgs.linuxPackages_latest;
}
5 changes: 5 additions & 0 deletions lenovo/thinkpad/p14s/amd/gen1/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
imports = [
../.
];
}
5 changes: 2 additions & 3 deletions lenovo/thinkpad/p14s/amd/gen2/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{ lib, pkgs, config, ... }:
{
imports = [
../../../../../common/pc/laptop/acpi_call.nix
../../../../../common/cpu/amd
../../../../../common/gpu/amd
../.
../../../../../common/cpu/amd/pstate.nix
];

# For suspending to RAM, set Config -> Power -> Sleep State to "Linux" in EFI.
Expand Down
12 changes: 12 additions & 0 deletions lenovo/thinkpad/p14s/amd/gen3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ lib, pkgs, ... }:

{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];

# For the Qualcomm NFA-725A (Device 1103) wireless network controller
# See https://bugzilla.redhat.com/show_bug.cgi?id=2047878
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
}
11 changes: 11 additions & 0 deletions lenovo/thinkpad/p14s/amd/gen4/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ lib, pkgs, config, ... }:
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];

# For the Qualcomm NFA765 [17cb:1103] wireless network controller
# See https://bugzilla.redhat.com/show_bug.cgi?id=2047878
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
}
22 changes: 22 additions & 0 deletions lenovo/thinkpad/p14s/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ lib, pkgs, ... }:

{
# P14s is a rebadged T14 with slight internal differences.
# This may change for future models, so we duplicate the T14 hierarchy here.

imports = [
../.
../../../common/pc/laptop/acpi_call.nix
../../../common/pc/laptop/ssd
];

# Force use of the amdgpu driver for backlight control on kernel versions where the
# native backlight driver is not already preferred. This is preferred over the
# "vendor" setting, in this case the thinkpad_acpi driver.
# See https://hansdegoede.livejournal.com/27130.html
# See https://lore.kernel.org/linux-acpi/[email protected]/
boot.kernelParams = lib.mkIf (lib.versionOlder pkgs.linux.version "6.2") [ "acpi_backlight=native" ];

# see https://github.com/NixOS/nixpkgs/issues/69289
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.2") pkgs.linuxPackages_latest;
}
1 change: 1 addition & 0 deletions lenovo/thinkpad/t14/amd/gen2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];

# For support of MEDIATEK Corp. Device 7961 wireless network controller, see https://lwn.net/Articles/843303/
Expand Down
1 change: 1 addition & 0 deletions lenovo/thinkpad/t14/amd/gen3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];

# For the Qualcomm NFA-725A (Device 1103) wireless network controller
Expand Down
12 changes: 12 additions & 0 deletions lenovo/thinkpad/t14/amd/gen4/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ lib, pkgs, config, ... }:

{
imports = [
../.
../../../../../common/cpu/amd/pstate.nix
];

# For the Qualcomm NFA765 [17cb:1103] wireless network controller
# See https://bugzilla.redhat.com/show_bug.cgi?id=2047878
boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.16") pkgs.linuxPackages_latest;
}