diff --git a/README.md b/README.md index aeb5ef9..4e0d41b 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ See code for all available configurations. | [Lenovo ThinkPad P53](lenovo/thinkpad/p53) | `` | | [Lenovo ThinkPad T14](lenovo/thinkpad/t14) | `` | | [Lenovo ThinkPad T14s](lenovo/thinkpad/t14s) | `` | -| [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | +| [Lenovo ThinkPad T14 AMD Gen 1](lenovo/thinkpad/t14/amd/gen1) | `` | +| [Lenovo ThinkPad T14 AMD Gen 2](lenovo/thinkpad/t14/amd/gen2) | `` | | [Lenovo ThinkPad T14s AMD Gen 1](lenovo/thinkpad/t14s/amd/gen1) | `` | | [Lenovo ThinkPad T410](lenovo/thinkpad/t410) | `` | | [Lenovo ThinkPad T420](lenovo/thinkpad/t420) | `` | diff --git a/flake.nix b/flake.nix index 593513c..ecc4695 100644 --- a/flake.nix +++ b/flake.nix @@ -56,6 +56,7 @@ lenovo-thinkpad-p53 = import ./lenovo/thinkpad/p53; lenovo-thinkpad-t14 = import ./lenovo/thinkpad/t14; lenovo-thinkpad-t14-amd-gen1 = import ./lenovo/thinkpad/t14/amd/gen1; + lenovo-thinkpad-t14-amd-gen2 = import ./lenovo/thinkpad/t14/amd/gen2; 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 b/lenovo/thinkpad/t14 deleted file mode 120000 index 7be5dd8..0000000 --- a/lenovo/thinkpad/t14 +++ /dev/null @@ -1 +0,0 @@ -t14s/ \ No newline at end of file diff --git a/lenovo/thinkpad/t14/amd/default.nix b/lenovo/thinkpad/t14/amd/default.nix new file mode 100644 index 0000000..fbd9f20 --- /dev/null +++ b/lenovo/thinkpad/t14/amd/default.nix @@ -0,0 +1,12 @@ +{ config, 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/t14/amd/gen1/default.nix b/lenovo/thinkpad/t14/amd/gen1/default.nix new file mode 100644 index 0000000..cb1ec7d --- /dev/null +++ b/lenovo/thinkpad/t14/amd/gen1/default.nix @@ -0,0 +1,8 @@ + +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ]; +} diff --git a/lenovo/thinkpad/t14/amd/gen2/default.nix b/lenovo/thinkpad/t14/amd/gen2/default.nix new file mode 100644 index 0000000..367e398 --- /dev/null +++ b/lenovo/thinkpad/t14/amd/gen2/default.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ]; + + # For support of MEDIATEK Corp. Device 7961 wireless network controller, see https://lwn.net/Articles/843303/ + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.12") pkgs.linuxPackages_latest; +} diff --git a/lenovo/thinkpad/t14/default.nix b/lenovo/thinkpad/t14/default.nix new file mode 100644 index 0000000..d783b21 --- /dev/null +++ b/lenovo/thinkpad/t14/default.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../common/pc/laptop/acpi_call.nix + ]; + + # For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux" in EFI. + # See https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#Suspend_issues + + # Fingerprint sensor requires a firmware-update to work. + + # Force use of the thinkpad_acpi driver for backlight control. + # This allows the backlight save/load systemd service to work. + boot.kernelParams = [ "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; +}