From fb635bfba081e9e707571abaf462d27d81580072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marijan=20Petri=C4=8Devi=C4=87?= Date: Thu, 1 Sep 2022 09:47:30 +0200 Subject: [PATCH] lenovo/z: add Lenovo Thinkpad Z(13) Co-authored-by: toastal --- README.md | 2 ++ flake.nix | 2 ++ lenovo/thinkpad/z/default.nix | 23 +++++++++++++++++++++++ lenovo/thinkpad/z/z13/default.nix | 5 +++++ 4 files changed, 32 insertions(+) create mode 100644 lenovo/thinkpad/z/default.nix create mode 100644 lenovo/thinkpad/z/z13/default.nix diff --git a/README.md b/README.md index 61ecbce..6e42cd4 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,8 @@ See code for all available configurations. | [Lenovo ThinkPad X260](lenovo/thinkpad/x260) | `` | | [Lenovo ThinkPad X270](lenovo/thinkpad/x270) | `` | | [Lenovo ThinkPad X280](lenovo/thinkpad/x280) | `` | +| [Lenovo ThinkPad Z Series](lenovo/thinkpad/z) | `` | +| [Lenovo ThinkPad Z13](lenovo/thinkpad/z/z13) | `` | | [MSI GS60 2QE](msi/gs60) | `` | | [MSI GL62/CX62](msi/gl62) | `` | | [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `` | diff --git a/flake.nix b/flake.nix index 7ce8937..94cdba6 100644 --- a/flake.nix +++ b/flake.nix @@ -109,6 +109,8 @@ lenovo-thinkpad-x260 = import ./lenovo/thinkpad/x260; lenovo-thinkpad-x270 = import ./lenovo/thinkpad/x270; lenovo-thinkpad-x280 = import ./lenovo/thinkpad/x280; + lenovo-thinkpad-z = import ./lenovo/thinkpad/z; + lenovo-thinkpad-z13 = import ./lenovo/thinkpad/z/z13; microsoft-surface = import ./microsoft/surface; microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; msi-gs60 = import ./msi/gs60; diff --git a/lenovo/thinkpad/z/default.nix b/lenovo/thinkpad/z/default.nix new file mode 100644 index 0000000..c3fdda2 --- /dev/null +++ b/lenovo/thinkpad/z/default.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: { + imports = [ + ../../../lenovo/thinkpad + ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix + ../../../common/gpu/amd + ../../../common/pc/laptop + ../../../common/pc/laptop/acpi_call.nix + ../../../common/pc/laptop/ssd + ]; + # kernel versions prior to 5.18 won't boot + boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "5.18") (lib.mkDefault pkgs.linuxPackages_5_18); + + hardware.enableRedistributableFirmware = lib.mkDefault true; + hardware.trackpoint.device = lib.mkDefault "TPPS/2 Elan TrackPoint"; + hardware.video.hidpi.enable = lib.mkDefault true; + + services.fprintd.enable = lib.mkDefault true; + + # kernel versions below 6.0 don't contain ACPI suspend2idle drivers for the Z13s AMD hardware + # my Z13 froze after waking up from suspend/ hibernate + services.logind.lidSwitch = lib.mkIf (lib.versionOlder pkgs.linux.version "6.00") (lib.mkDefault "lock"); +} diff --git a/lenovo/thinkpad/z/z13/default.nix b/lenovo/thinkpad/z/z13/default.nix new file mode 100644 index 0000000..b351777 --- /dev/null +++ b/lenovo/thinkpad/z/z13/default.nix @@ -0,0 +1,5 @@ +{ config, lib, pkgs, ... }: { + imports = [ + ../../../../lenovo/thinkpad/z + ]; +}