From 19e5d3c9d984d35edfd6ed1700c67d25b5030ed0 Mon Sep 17 00:00:00 2001 From: James Alseth Date: Sun, 3 Mar 2024 10:27:47 -0800 Subject: [PATCH] Add Thinkpad X13 Gen1 AMD variant --- README.md | 7 ++++--- flake.nix | 3 ++- lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md | 12 ++++++++++++ lenovo/thinkpad/x13/amd/default.nix | 6 ++++++ lenovo/thinkpad/x13/common.nix | 10 ++++++++++ lenovo/thinkpad/x13/default.nix | 16 ++++++---------- lenovo/thinkpad/x13/intel/default.nix | 7 +++++++ lenovo/thinkpad/x13/yoga/default.nix | 2 +- 8 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md create mode 100644 lenovo/thinkpad/x13/amd/default.nix create mode 100644 lenovo/thinkpad/x13/common.nix create mode 100644 lenovo/thinkpad/x13/intel/default.nix diff --git a/README.md b/README.md index 641552d..49754f0 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,8 @@ See code for all available configurations. | [Lenovo ThinkPad X1 Nano Gen 1](lenovo/thinkpad/x1-nano/gen1) | `` | | [Lenovo ThinkPad X13 Yoga](lenovo/thinkpad/x13/yoga) | `` | | [Lenovo ThinkPad X13 Yoga (3th Gen)](lenovo/thinkpad/x13/yoga/3th-gen) | `` | -| [Lenovo ThinkPad X13](lenovo/thinkpad/x13) | `` | +| [Lenovo ThinkPad X13 (Intel)](lenovo/thinkpad/x13/intel) | `` | +| [Lenovo ThinkPad X13 (AMD)](lenovo/thinkpad/x13/amd) | `` | | [Lenovo ThinkPad X140e](lenovo/thinkpad/x140e) | `` | | [Lenovo ThinkPad X200s](lenovo/thinkpad/x200s) | `` | | [Lenovo ThinkPad X220](lenovo/thinkpad/x220) | `` | @@ -249,8 +250,8 @@ See code for all available configurations. | [Microsoft Surface Range (Common Modules)](microsoft/surface/common) | `` | | [Microsoft Surface Pro 3](microsoft/surface-pro/3) | `` | | [Morefine M600](morefine/m600) | `` | -| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `` | -| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `` | +| [NXP iMX8 MPlus Evaluation Kit](nxp/imx8mp-evk) | `` | +| [NXP iMX8 MQuad Evaluation Kit](nxp/imx8mq-evk) | `` | | [Hardkernel Odroid HC4](hardkernel/odroid-hc4/default.nix) | `` | | [Hardkernel Odroid H3](hardkernel/odroid-h3/default.nix) | `` | | [Omen 15-en0010ca](omen/15-en0010ca) | `` | diff --git a/flake.nix b/flake.nix index 5943da2..8488f18 100644 --- a/flake.nix +++ b/flake.nix @@ -159,7 +159,8 @@ lenovo-thinkpad-x1-extreme-gen4 = import ./lenovo/thinkpad/x1-extreme/gen4; lenovo-thinkpad-x1-nano = import ./lenovo/thinkpad/x1-nano; lenovo-thinkpad-x1-nano-gen1 = import ./lenovo/thinkpad/x1-nano/gen1; - lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13; + lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13/intel; + lenovo-thinkpad-x13-amd = import ./lenovo/thinkpad/x13/amd; lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga; lenovo-thinkpad-x13-yoga-3th-gen = import ./lenovo/thinkpad/x13/yoga/3th-gen; lenovo-thinkpad-x140e = import ./lenovo/thinkpad/x140e; diff --git a/lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md b/lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md new file mode 100644 index 0000000..a770347 --- /dev/null +++ b/lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md @@ -0,0 +1,12 @@ +# Thinkpad X13 Deprecations + +## Overview + +The X13 has multiple variants. Originally, the configs only supported Intel +hardware. + +## How to update + +If you previously imported the module under `lenovo/thinkpad/x13`, you can now +import `lenovo/thinkpad/x13/intel` instead. Users with the AMD variant should +import `lenovo/thinkpad/x13/amd`. diff --git a/lenovo/thinkpad/x13/amd/default.nix b/lenovo/thinkpad/x13/amd/default.nix new file mode 100644 index 0000000..61ca7b7 --- /dev/null +++ b/lenovo/thinkpad/x13/amd/default.nix @@ -0,0 +1,6 @@ +{ ... }: { + imports = [ + ../common.nix + ../../../../common/cpu/amd + ]; +} diff --git a/lenovo/thinkpad/x13/common.nix b/lenovo/thinkpad/x13/common.nix new file mode 100644 index 0000000..e6f79fc --- /dev/null +++ b/lenovo/thinkpad/x13/common.nix @@ -0,0 +1,10 @@ +{ ... }: { + imports = [ + ../. + ../../../common/pc/laptop/acpi_call.nix + ../../../common/pc/laptop/ssd + ]; + + # Somehow psmouse does not load automatically on boot for me + boot.initrd.kernelModules = [ "psmouse" ]; +} diff --git a/lenovo/thinkpad/x13/default.nix b/lenovo/thinkpad/x13/default.nix index 911dc5b..5e5c992 100644 --- a/lenovo/thinkpad/x13/default.nix +++ b/lenovo/thinkpad/x13/default.nix @@ -1,12 +1,8 @@ -{ ... }: { - # Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844 - imports = [ - ../. - ../../../common/cpu/intel - ../../../common/pc/laptop/acpi_call.nix - ../../../common/pc/laptop/ssd +{ + assertions = [ + { + assertion = false; + message = "Importing the x13/ (default.nix) directly is deprecated! See https://github.com/NixOS/nixos-hardware/blob/master/lenovo/thinkpad/x13/OLD-BEHAVIOUR-DEPRECATED.md for more details."; + } ]; - - # Somehow psmouse does not load automatically on boot for me - boot.initrd.kernelModules = [ "psmouse" ]; } diff --git a/lenovo/thinkpad/x13/intel/default.nix b/lenovo/thinkpad/x13/intel/default.nix new file mode 100644 index 0000000..ed4771f --- /dev/null +++ b/lenovo/thinkpad/x13/intel/default.nix @@ -0,0 +1,7 @@ +{ ... }: { + # Reference to hardware: https://certification.ubuntu.com/hardware/202004-27844 + imports = [ + ../common.nix + ../../../../common/cpu/intel + ]; +} diff --git a/lenovo/thinkpad/x13/yoga/default.nix b/lenovo/thinkpad/x13/yoga/default.nix index dfabfd4..5a454d6 100644 --- a/lenovo/thinkpad/x13/yoga/default.nix +++ b/lenovo/thinkpad/x13/yoga/default.nix @@ -1,6 +1,6 @@ { config, lib, ... }: { imports = [ - ../. + ../intel ../../yoga.nix ];