From 6f10c889c0c0144a76086bae609bad2383e0ac07 Mon Sep 17 00:00:00 2001 From: Daniel Ebbert Date: Wed, 18 Aug 2021 12:43:51 +0200 Subject: [PATCH] Init Lenovo ThinkPad E14 --- README.md | 2 ++ flake.nix | 2 ++ lenovo/thinkpad/e14/amd/default.nix | 23 +++++++++++++++++++++++ lenovo/thinkpad/e14/default.nix | 14 ++++++++++++++ lenovo/thinkpad/e14/intel/default.nix | 10 ++++++++++ 5 files changed, 51 insertions(+) create mode 100644 lenovo/thinkpad/e14/amd/default.nix create mode 100644 lenovo/thinkpad/e14/default.nix create mode 100644 lenovo/thinkpad/e14/intel/default.nix diff --git a/README.md b/README.md index 25caa0f..e086655 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ See code for all available configurations. | [GPD MicroPC](gpd/micropc) | `` | | [Inverse Path USB armory](inversepath/usbarmory) | `` | | [Lenovo IdeaPad Z510](lenovo/ideapad/z510) | `` | +| [Lenovo ThinkPad E14 (Intel)](lenovo/thinkpad/e14/intel) | `` | +| [Lenovo ThinkPad E14 (AMD)](lenovo/thinkpad/e14/amd) | `` | | [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | | [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `` | | [Lenovo ThinkPad L13](lenovo/thinkpad/l13) | `` | diff --git a/flake.nix b/flake.nix index 9224dfc..c6707d0 100644 --- a/flake.nix +++ b/flake.nix @@ -35,6 +35,8 @@ gpd-micropc = import ./gpd/micropc; inversepath-usbarmory = import ./inversepath/usbarmory; lenovo-ideapad-z510 = import ./lenovo/ideapad/z510; + lenovo-thinkpad-e14-intel = import ./lenovo/thinkpad/e14/intel; + lenovo-thinkpad-e14-amd = import ./lenovo/thinkpad/e14/amd; lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13; diff --git a/lenovo/thinkpad/e14/amd/default.nix b/lenovo/thinkpad/e14/amd/default.nix new file mode 100644 index 0000000..c2d1534 --- /dev/null +++ b/lenovo/thinkpad/e14/amd/default.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../../common/cpu/amd + ]; + + boot.kernelParams = [ + # With BIOS version 1.12 and the IOMMU enabled, the amdgpu driver + # either crashes or is not able to attach to the GPU depending on + # the kernel version. I've seen no issues with the IOMMU disabled. + # + # BIOS version 1.13 claims to fix IOMMU issues, but we leave the + # IOMMU off to avoid a sad experience for those people that drew + # the short straw when they bought their laptop. + "iommu=off" + ]; + + # As of writing this, Linux 5.8 is the oldest kernel that is still + # supported and has decent Renoir support. + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.8") pkgs.linuxPackages_latest; +} diff --git a/lenovo/thinkpad/e14/default.nix b/lenovo/thinkpad/e14/default.nix new file mode 100644 index 0000000..e014b7d --- /dev/null +++ b/lenovo/thinkpad/e14/default.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../common/pc/laptop/acpi_call.nix + ]; + + boot.kernelParams = [ + # Force use of the thinkpad_acpi driver for backlight control. + # This allows the backlight save/load systemd service to work. + "acpi_backlight=native" + ]; +} diff --git a/lenovo/thinkpad/e14/intel/default.nix b/lenovo/thinkpad/e14/intel/default.nix new file mode 100644 index 0000000..088289f --- /dev/null +++ b/lenovo/thinkpad/e14/intel/default.nix @@ -0,0 +1,10 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ../. + ../../../../common/cpu/intel + ]; + + services.throttled.enable = lib.mkDefault true; +}