From c076216644bcd1112a6e02094a81c2c461d7cbab Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 1 Jul 2021 13:52:08 +0200 Subject: [PATCH] lenovo/thinkpad: Refactor of yogas --- README.md | 4 ++-- flake.nix | 4 ++-- .../thinkpad/{l13-yoga/default.nix => l13/yoga.nix} | 6 ++---- lenovo/thinkpad/x13-yoga/default.nix | 13 ------------- lenovo/thinkpad/x13/yoga.nix | 8 ++++++++ lenovo/thinkpad/yoga.nix | 6 ++++++ 6 files changed, 20 insertions(+), 21 deletions(-) rename lenovo/thinkpad/{l13-yoga/default.nix => l13/yoga.nix} (64%) delete mode 100644 lenovo/thinkpad/x13-yoga/default.nix create mode 100644 lenovo/thinkpad/x13/yoga.nix create mode 100644 lenovo/thinkpad/yoga.nix diff --git a/README.md b/README.md index cb30dd3..98609ab 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ See code for all available configurations. | [Lenovo ThinkPad E470](lenovo/thinkpad/e470) | `` | | [Lenovo ThinkPad E495](lenovo/thinkpad/e495) | `` | | [Lenovo ThinkPad L13](lenovo/thinkpad/l13) | `` | -| [Lenovo ThinkPad L13 Yoga](lenovo/thinkpad/l13-yoga) | `` | +| [Lenovo ThinkPad L13 Yoga](lenovo/thinkpad/l13/yoga.nix) | `` | | [Lenovo ThinkPad L14 (Intel)](lenovo/thinkpad/l14/intel) | `` | | [Lenovo ThinkPad L14 (AMD)](lenovo/thinkpad/l14/amd) | `` | | [Lenovo ThinkPad P1](thinkpad/p1) | `` | @@ -125,7 +125,7 @@ See code for all available configurations. | [Lenovo ThinkPad T480s](lenovo/thinkpad/t480s) | `` | | [Lenovo ThinkPad T490](lenovo/thinkpad/t490) | `` | | [Lenovo ThinkPad T495](lenovo/thinkpad/t495) | `` | -| [Lenovo ThinkPad X113 Yoga](lenovo/thinkpad/x13-yoga) | `` | +| [Lenovo ThinkPad X13 Yoga](lenovo/thinkpad/x13/yoga.nix) | `` | | [Lenovo ThinkPad X140e](lenovo/thinkpad/x140e) | `` | | [Lenovo ThinkPad X200s](lenovo/thinkpad/x200s) | `` | | [Lenovo ThinkPad X220](lenovo/thinkpad/x220) | `` | diff --git a/flake.nix b/flake.nix index a7ad2a3..67349b3 100644 --- a/flake.nix +++ b/flake.nix @@ -37,7 +37,7 @@ lenovo-thinkpad-e470 = import ./lenovo/thinkpad/e470; lenovo-thinkpad-e495 = import ./lenovo/thinkpad/e495; lenovo-thinkpad-l13 = import ./lenovo/thinkpad/l13; - lenovo-thinkpad-l13-yoga = import ./lenovo/thinkpad/l13-yoga; + lenovo-thinkpad-l13-yoga = import ./lenovo/thinkpad/l13-yoga/yoga.nix; lenovo-thinkpad-l14-intel = import ./lenovo/thinkpad/l14/intel; lenovo-thinkpad-l14-amd = import ./lenovo/thinkpad/l14/amd; lenovo-thinkpad-p1 = import ./lenovo/thinkpad/p1; @@ -74,7 +74,7 @@ lenovo-thinkpad-x1-extreme = import ./lenovo/thinkpad/x1-extreme; lenovo-thinkpad-x1-extreme-gen2 = import ./lenovo/thinkpad/x1-extreme/gen2; lenovo-thinkpad-x13 = import ./lenovo/thinkpad/x13; - lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13-yoga; + lenovo-thinkpad-x13-yoga = import ./lenovo/thinkpad/x13/yoga.nix; microsoft-surface = import ./microsoft/surface; microsoft-surface-pro-3 = import ./microsoft/surface-pro/3; pcengines-apu = import ./pcengines/apu; diff --git a/lenovo/thinkpad/l13-yoga/default.nix b/lenovo/thinkpad/l13/yoga.nix similarity index 64% rename from lenovo/thinkpad/l13-yoga/default.nix rename to lenovo/thinkpad/l13/yoga.nix index df95b14..fb11aac 100644 --- a/lenovo/thinkpad/l13-yoga/default.nix +++ b/lenovo/thinkpad/l13/yoga.nix @@ -1,11 +1,9 @@ { nixos, lib, pkgs, config, stdenv, ... }: { imports = [ - ../l13 + ./. + ../yoga.nix ]; - # automatic screen orientation - hardware.sensor.iio.enable = true; - services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; } diff --git a/lenovo/thinkpad/x13-yoga/default.nix b/lenovo/thinkpad/x13-yoga/default.nix deleted file mode 100644 index 2653910..0000000 --- a/lenovo/thinkpad/x13-yoga/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, lib, ... }: { - imports = [ - ../. - ../../../common/cpu/intel - ../../../common/pc/laptop/acpi_call.nix - ../../../common/pc/laptop/ssd - ]; - - # automatic screen orientation - hardware.sensor.iio.enable = true; - - services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; -} diff --git a/lenovo/thinkpad/x13/yoga.nix b/lenovo/thinkpad/x13/yoga.nix new file mode 100644 index 0000000..00a962b --- /dev/null +++ b/lenovo/thinkpad/x13/yoga.nix @@ -0,0 +1,8 @@ +{ config, lib, ... }: { + imports = [ + ./. + ../yoga.nix + ]; + + services.xserver.wacom.enable = lib.mkDefault config.services.xserver.enable; +} diff --git a/lenovo/thinkpad/yoga.nix b/lenovo/thinkpad/yoga.nix new file mode 100644 index 0000000..c624e1b --- /dev/null +++ b/lenovo/thinkpad/yoga.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, ... }: + +{ + # automatic screen orientation + hardware.sensor.iio.enable = true; +}