commit a9799e4953a8a42d9ba3484ce1cb61c0fd99ad3d
parent df90773540b8c125dc7f6becb0caa09eabb2bdc4
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 19 Aug 2022 12:21:38 +0000
systems/hardware/thinkpad-x1g9: add bolt, firware and tlp
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
1 file changed, 36 insertions(+), 0 deletions(-)
diff --git a/systems/hardware/thinkpad-x1g9.nix b/systems/hardware/thinkpad-x1g9.nix
@@ -27,7 +27,43 @@
loader.efi.canTouchEfiVariables = true;
};
hardware = {
+ enableAllFirmware = true;
trackpoint.enable = false;
cpu.intel.updateMicrocode = true;
};
+ services = {
+ hardware.bolt.enable = true;
+ # throttled.enable = true; # might not be needed
+ tlp = {
+ settings = {
+ # CPU optimizations
+ "CPU_SCALING_GOVERNOR_ON_AC" = "performance";
+ "CPU_SCALING_GOVERNOR_ON_BAT" = "powersave";
+ "CPU_MIN_PERF_ON_AC" = 0;
+ "CPU_MAX_PERF_ON_AC" = 100;
+ "CPU_MIN_PERF_ON_BAT" = 0;
+ "CPU_MAX_PERF_ON_BAT" = 50;
+ # DEVICES (wifi, ..)
+ "DEVICES_TO_DISABLE_ON_STARTUP" = "";
+ "DEVICES_TO_ENABLE_ON_AC" = "bluetooth wifi wwan";
+ "DEVICES_TO_DISABLE_ON_BAT" = "";
+ # Network management
+ "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = "wifi";
+ "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = "";
+ "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = "";
+ "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = "wifi";
+ "DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT" = "";
+ "DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT" = "";
+ # Docking
+ "DEVICES_TO_DISABLE_ON_DOCK" = "wifi";
+ "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi";
+ # Make sure it uses the right hard drive
+ "DISK_DEVICES" = "nvme0n1p1";
+ };
+ };
+ udev.extraRules = ''
+ # Rules for Lenovo Thinkpad WS Dock
+ ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"
+ '';
+ };
}