home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 293be2cabc81f3ed7ed9c67055237ef08d8b454d
parent 1d677639e5294fc97efcb4b7523756620c948ab7
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Thu, 23 Sep 2021 11:47:40 +0200

systems/hardware: use tlp.settings 🏬

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Msystems/hardware/lenovo-p1.nix | 40++++++++++++++++++++--------------------
Msystems/hardware/lenovo-p50.nix | 40++++++++++++++++++++--------------------
Msystems/hardware/thinkpad-t460s.nix | 40++++++++++++++++++++--------------------
Msystems/hardware/thinkpad-t480s.nix | 40++++++++++++++++++++--------------------
Msystems/hardware/thinkpad-x220.nix | 57+++++++++++++++++++++++++++++----------------------------
5 files changed, 109 insertions(+), 108 deletions(-)

diff --git a/systems/hardware/lenovo-p1.nix b/systems/hardware/lenovo-p1.nix @@ -22,31 +22,31 @@ in services.throttled.enable = lib.mkDefault true; services = { tlp = { - extraConfig = '' + 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 + "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="" + "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="" - DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" - DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" - DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = ""; + "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = ""; + "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" + "DEVICES_TO_DISABLE_ON_DOCK" = "wifi"; + "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi"; # Make sure it uses the right hard drive - #DISK_DEVICES="nvme0n1p2" - ''; + "DISK_DEVICES" = "nvme0n1p2"; + }; }; }; } diff --git a/systems/hardware/lenovo-p50.nix b/systems/hardware/lenovo-p50.nix @@ -27,31 +27,31 @@ in services.throttled.enable = lib.mkDefault true; services = { tlp = { - extraConfig = '' + 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 + "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="" + "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="" - DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" - DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" - DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = ""; + "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = ""; + "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" + "DEVICES_TO_DISABLE_ON_DOCK" = "wifi"; + "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi"; # Make sure it uses the right hard drive - DISK_DEVICES="nvme0n1p2" - ''; + "DISK_DEVICES" = "nvme0n1p2"; + }; }; udev.extraRules = '' # Rules for Lenovo Thinkpad WS Dock diff --git a/systems/hardware/thinkpad-t460s.nix b/systems/hardware/thinkpad-t460s.nix @@ -11,31 +11,31 @@ in nix.maxJobs = 12; services = { tlp = { - extraConfig = '' + 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 + "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="" + "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="" - DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" - DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" - DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = ""; + "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = ""; + "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" + "DEVICES_TO_DISABLE_ON_DOCK" = "wifi"; + "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi"; # Make sure it uses the right hard drive - DISK_DEVICES="nvme0n1p3" - ''; + "DISK_DEVICES" = "nvme0n1p3"; + }; }; xserver = { dpi = 128; diff --git a/systems/hardware/thinkpad-t480s.nix b/systems/hardware/thinkpad-t480s.nix @@ -23,31 +23,31 @@ in services = { throttled.enable = true; tlp = { - extraConfig = '' + 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 + "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="" + "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="" - DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" - DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" - DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = ""; + "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = ""; + "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" + "DEVICES_TO_DISABLE_ON_DOCK" = "wifi"; + "DEVICES_TO_ENABLE_ON_UNDOCK" = "wifi"; # Make sure it uses the right hard drive - DISK_DEVICES="nvme0n1p3" - ''; + "DISK_DEVICES" = "nvme0n1p3"; + }; }; udev.extraRules = '' # Rules for Lenovo Thinkpad WS Dock diff --git a/systems/hardware/thinkpad-x220.nix b/systems/hardware/thinkpad-x220.nix @@ -27,37 +27,38 @@ in services = { fprintd.enable = true; tlp = { - extraConfig = '' + 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 - CPU_BOOST_ON_AC=1 - CPU_BOOST_ON_BAT=0 + "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; + "CPU_BOOST_ON_AC" = 1; + "CPU_BOOST_ON_BAT" = 0; # DEVICES (wifi, ..) - DEVICES_TO_DISABLE_ON_STARTUP="bluetooth" - DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan" - DEVICES_TO_DISABLE_ON_BAT="bluetooth" + "DEVICES_TO_DISABLE_ON_STARTUP" = "bluetooth"; + "DEVICES_TO_ENABLE_ON_AC" = "bluetooth wifi wwan"; + "DEVICES_TO_DISABLE_ON_BAT" = "bluetooth"; # Network management - DEVICES_TO_DISABLE_ON_LAN_CONNECT="" - DEVICES_TO_DISABLE_ON_WIFI_CONNECT="" - DEVICES_TO_DISABLE_ON_WWAN_CONNECT="" - DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" - DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" - DISK_IDLE_SECS_ON_AC=0 - DISK_IDLE_SECS_ON_BAT=2 - MAX_LOST_WORK_SECS_ON_AC=15 - MAX_LOST_WORK_SECS_ON_BAT=60 - DISK_DEVICES="ata-Corsair_Force_LX_SSD_15256501000102160059" - SOUND_POWER_SAVE_ON_AC=0 - SOUND_POWER_SAVE_ON_BAT=1 - USB_AUTOSUSPEND=1 - USB_BLACKLIST_BTUSB=1 - ''; + "DEVICES_TO_DISABLE_ON_LAN_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WIFI_CONNECT" = ""; + "DEVICES_TO_DISABLE_ON_WWAN_CONNECT" = ""; + "DEVICES_TO_ENABLE_ON_LAN_DISCONNECT" = ""; + "DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT" = ""; + "DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT" = ""; + # Misc + "DISK_IDLE_SECS_ON_AC" = 0; + "DISK_IDLE_SECS_ON_BAT" = 2; + "MAX_LOST_WORK_SECS_ON_AC" = 15; + "MAX_LOST_WORK_SECS_ON_BAT" = 60; + "DISK_DEVICES" = "ata-Corsair_Force_LX_SSD_15256501000102160059"; + "SOUND_POWER_SAVE_ON_AC" = 0; + "SOUND_POWER_SAVE_ON_BAT" = 1; + "USB_AUTOSUSPEND" = 1; + "USB_BLACKLIST_BTUSB" = 1; + }; }; }; }