From 502f748f0d45e841c1f6fd5438f508e332d41f2a Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 14 Oct 2026 21:19:03 +0300 Subject: [PATCH] feat(ThinkPad): Added thinkPad special settings --- host/ThinkPad/configuration.nix | 2 +- host/ThinkPad/modules/thinkpad.nix | 51 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 host/ThinkPad/modules/thinkpad.nix diff --git a/host/ThinkPad/configuration.nix b/host/ThinkPad/configuration.nix index 39b54e9..61f25d8 100644 --- a/host/ThinkPad/configuration.nix +++ b/host/ThinkPad/configuration.nix @@ -9,7 +9,7 @@ ./modules/swap.nix ./modules/intel.nix ./modules/grab.nix - #./modules/nvidia.nix + ./modules/thinkpad.nix ./modules/fingerprint.nix (import ../modules/common.nix { diff --git a/host/ThinkPad/modules/thinkpad.nix b/host/ThinkPad/modules/thinkpad.nix new file mode 100644 index 0000000..de08663 --- /dev/null +++ b/host/ThinkPad/modules/thinkpad.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, ... }: { + hardware = { + enableRedistributableFirmware = true; + + trackpoint = { + enable = true; + emulateWheel = true; + }; + }; + + powerManagement.enable = true; + + services = { + fwupd.enable = true; + thermald.enable = true; + fprintd.enable = true; + + logind.settings.Login = { + HandleLidSwitch = "suspend-then-hibernate"; + HandleLidSwitchExternalPower = "suspend-then-hibernate"; + HandlePowerKey = "poweroff"; + }; + + tlp.settings = { + START_CHARGE_THRESH_BAT0 = 70; + STOP_CHARGE_THRESH_BAT0 = 95; + START_CHARGE_THRESH_BAT1 = 70; + STOP_CHARGE_THRESH_BAT1 = 85; + RESTORE_THRESHOLDS_ON_BAT = 1; + + AHCI_RUNTIME_PM_ON_AC = "on"; + AHCI_RUNTIME_PM_ON_BAT = "auto"; + SATA_LINKPWR_ON_AC = "med_power_with_dipm"; + SATA_LINKPWR_ON_BAT = "med_power_with_dipm"; + + USB_AUTOSUSPEND = 1; + }; + }; + + networking.networkmanager.wifi.powersave = true; + + environment.systemPackages = with pkgs; [ + acpi + lm_sensors + pciutils + powertop + smartmontools + usbutils + nvme-cli + ]; +}