From f0cf876fa72e8ef4fcaade0a857183f420c9bafa Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:01:16 -0700 Subject: [PATCH 1/8] lenovo/thinkpad/p14s: align with Thinkpad T14 configs --- lenovo/thinkpad/p14s/amd/default.nix | 12 ++++++++++++ lenovo/thinkpad/p14s/amd/gen2/default.nix | 4 +--- lenovo/thinkpad/p14s/default.nix | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 lenovo/thinkpad/p14s/amd/default.nix create mode 100644 lenovo/thinkpad/p14s/default.nix diff --git a/lenovo/thinkpad/p14s/amd/default.nix b/lenovo/thinkpad/p14s/amd/default.nix new file mode 100644 index 0000000..cbef7c0 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/default.nix @@ -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; +} diff --git a/lenovo/thinkpad/p14s/amd/gen2/default.nix b/lenovo/thinkpad/p14s/amd/gen2/default.nix index 89632e2..664f83d 100644 --- a/lenovo/thinkpad/p14s/amd/gen2/default.nix +++ b/lenovo/thinkpad/p14s/amd/gen2/default.nix @@ -1,9 +1,7 @@ { lib, pkgs, config, ... }: { imports = [ - ../../../../../common/pc/laptop/acpi_call.nix - ../../../../../common/cpu/amd - ../../../../../common/gpu/amd + ../. ]; # For suspending to RAM, set Config -> Power -> Sleep State to "Linux" in EFI. diff --git a/lenovo/thinkpad/p14s/default.nix b/lenovo/thinkpad/p14s/default.nix new file mode 100644 index 0000000..401eba9 --- /dev/null +++ b/lenovo/thinkpad/p14s/default.nix @@ -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/20221105145258.12700-1-hdegoede@redhat.com/ + 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; +} From 086428d4da29a7f6a9f83f82c5aa388edc76214a Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:02:48 -0700 Subject: [PATCH 2/8] lenovo/thinkpad/p14s/amd/gen1: init --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/p14s/amd/gen1/default.nix | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 lenovo/thinkpad/p14s/amd/gen1/default.nix diff --git a/README.md b/README.md index fe92f58..8a48d3d 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,7 @@ See code for all available configurations. | [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `` | | [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `` | | [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `` | +| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | | [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | diff --git a/flake.nix b/flake.nix index 69e0a31..062c735 100644 --- a/flake.nix +++ b/flake.nix @@ -125,6 +125,7 @@ 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-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; diff --git a/lenovo/thinkpad/p14s/amd/gen1/default.nix b/lenovo/thinkpad/p14s/amd/gen1/default.nix new file mode 100644 index 0000000..665d3d4 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen1/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ../. + ]; +} From 4a64e8808bf1769a24835dc2f3f91bba0353a810 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:03:46 -0700 Subject: [PATCH 3/8] lenovo/thinkpad/p14s/amd/gen3: init --- README.md | 3 ++- flake.nix | 1 + lenovo/thinkpad/p14s/amd/gen3/default.nix | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 lenovo/thinkpad/p14s/amd/gen3/default.nix diff --git a/README.md b/README.md index 8a48d3d..df85322 100644 --- a/README.md +++ b/README.md @@ -190,8 +190,9 @@ See code for all available configurations. | [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `` | | [Lenovo ThinkPad L480](lenovo/thinkpad/l480) | `` | | [Lenovo ThinkPad P1 Gen 3](lenovo/thinkpad/p1/3th-gen) | `` | -| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | +| [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | | [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | +| [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | diff --git a/flake.nix b/flake.nix index 062c735..281a8f7 100644 --- a/flake.nix +++ b/flake.nix @@ -127,6 +127,7 @@ 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-p16s-amd-gen1 = import ./lenovo/thinkpad/p16s/amd/gen1; lenovo-thinkpad-p50 = import ./lenovo/thinkpad/p50; lenovo-thinkpad-p51 = import ./lenovo/thinkpad/p51; diff --git a/lenovo/thinkpad/p14s/amd/gen3/default.nix b/lenovo/thinkpad/p14s/amd/gen3/default.nix new file mode 100644 index 0000000..f70dde4 --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen3/default.nix @@ -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; +} From c93ff0d0d6ec9be1aee4e643e1cf87a1269edca0 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:04:14 -0700 Subject: [PATCH 4/8] lenovo/thinkpad/p14s/amd/gen4: init --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/p14s/amd/gen4/default.nix | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 lenovo/thinkpad/p14s/amd/gen4/default.nix diff --git a/README.md b/README.md index df85322..9ed607c 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,7 @@ See code for all available configurations. | [Lenovo ThinkPad P14s AMD Gen 1](lenovo/thinkpad/p14s/amd/gen1) | `` | | [Lenovo ThinkPad P14s AMD Gen 2](lenovo/thinkpad/p14s/amd/gen2) | `` | | [Lenovo ThinkPad P14s AMD Gen 3](lenovo/thinkpad/p14s/amd/gen3) | `` | +| [Lenovo ThinkPad P14s AMD Gen 4](lenovo/thinkpad/p14s/amd/gen4) | `` | | [Lenovo ThinkPad P16s AMD Gen 1](lenovo/thinkpad/p16s/amd/gen1) | `` | | [Lenovo ThinkPad P1](lenovo/thinkpad/p1) | `` | | [Lenovo ThinkPad P50](lenovo/thinkpad/p50) | `` | diff --git a/flake.nix b/flake.nix index 281a8f7..c79d0c5 100644 --- a/flake.nix +++ b/flake.nix @@ -128,6 +128,7 @@ 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; diff --git a/lenovo/thinkpad/p14s/amd/gen4/default.nix b/lenovo/thinkpad/p14s/amd/gen4/default.nix new file mode 100644 index 0000000..cc6244e --- /dev/null +++ b/lenovo/thinkpad/p14s/amd/gen4/default.nix @@ -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; +} From ff39be3fc093a7c816a5c36068252de8d211ee93 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:04:48 -0700 Subject: [PATCH 5/8] lenovo/thinkpad/t14/amd/gen4: init --- README.md | 1 + flake.nix | 1 + lenovo/thinkpad/t14/amd/gen4/default.nix | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 lenovo/thinkpad/t14/amd/gen4/default.nix diff --git a/README.md b/README.md index 9ed607c..57400f8 100644 --- a/README.md +++ b/README.md @@ -203,6 +203,7 @@ See code for all available configurations. | [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `` | | [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `` | | [Lenovo ThinkPad T14 AMD Gen 3](lenovo/thinkpad/t14/amd/gen3) | `` | +| [Lenovo ThinkPad T14 AMD Gen 4](lenovo/thinkpad/t14/amd/gen4) | `` | | [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `` | | [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | | [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `` | diff --git a/flake.nix b/flake.nix index c79d0c5..15dd442 100644 --- a/flake.nix +++ b/flake.nix @@ -138,6 +138,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; diff --git a/lenovo/thinkpad/t14/amd/gen4/default.nix b/lenovo/thinkpad/t14/amd/gen4/default.nix new file mode 100644 index 0000000..e61a3a0 --- /dev/null +++ b/lenovo/thinkpad/t14/amd/gen4/default.nix @@ -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; +} From 5e63ebbfcc1614935a50d4ff755dff381c46a987 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:14:05 -0700 Subject: [PATCH 6/8] lenovo/thinkpad/p14s/amd/gen2: enable amd_pstate --- lenovo/thinkpad/p14s/amd/gen2/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lenovo/thinkpad/p14s/amd/gen2/default.nix b/lenovo/thinkpad/p14s/amd/gen2/default.nix index 664f83d..7c496f6 100644 --- a/lenovo/thinkpad/p14s/amd/gen2/default.nix +++ b/lenovo/thinkpad/p14s/amd/gen2/default.nix @@ -2,6 +2,7 @@ { imports = [ ../. + ../../../../../common/cpu/amd/pstate.nix ]; # For suspending to RAM, set Config -> Power -> Sleep State to "Linux" in EFI. From e502b1f7c248bdb836f4dd82049a293524a07637 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:15:57 -0700 Subject: [PATCH 7/8] lenovo/thinkpad/t14/amd/gen2: enable amd_pstate --- lenovo/thinkpad/t14/amd/gen2/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lenovo/thinkpad/t14/amd/gen2/default.nix b/lenovo/thinkpad/t14/amd/gen2/default.nix index 795b9a8..0e74572 100644 --- a/lenovo/thinkpad/t14/amd/gen2/default.nix +++ b/lenovo/thinkpad/t14/amd/gen2/default.nix @@ -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/ From e356911c14ff62f50e35412ecd3d0b828e46352a Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Fri, 13 Oct 2023 19:05:00 -0700 Subject: [PATCH 8/8] lenovo/thinkpad/t14/amd/gen3: enable amd_pstate --- lenovo/thinkpad/t14/amd/gen3/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lenovo/thinkpad/t14/amd/gen3/default.nix b/lenovo/thinkpad/t14/amd/gen3/default.nix index 617a3a4..f70dde4 100644 --- a/lenovo/thinkpad/t14/amd/gen3/default.nix +++ b/lenovo/thinkpad/t14/amd/gen3/default.nix @@ -3,6 +3,7 @@ { imports = [ ../. + ../../../../../common/cpu/amd/pstate.nix ]; # For the Qualcomm NFA-725A (Device 1103) wireless network controller