about summary refs log tree commit diff
path: root/users/tazjin
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin')
-rw-r--r--users/tazjin/nixos/tverskoy/default.nix15
1 files changed, 12 insertions, 3 deletions
diff --git a/users/tazjin/nixos/tverskoy/default.nix b/users/tazjin/nixos/tverskoy/default.nix
index 5a87c4df3ef2..f44bab62d8e3 100644
--- a/users/tazjin/nixos/tverskoy/default.nix
+++ b/users/tazjin/nixos/tverskoy/default.nix
@@ -32,7 +32,7 @@ in lib.fix(self: {
     ];
   };
 
-  boot = {
+  boot = rec {
     initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
     initrd.kernelModules = [ ];
 
@@ -41,8 +41,10 @@ in lib.fix(self: {
       zfs rollback -r zpool/ephemeral/home@tazjin-clean
     '';
 
+    # Install thinkpad modules for TLP
+    extraModulePackages = [ kernelPackages.acpi_call ];
+
     kernelModules = [ "kvm-amd" "i2c_dev" ];
-    extraModulePackages = [ ];
     kernelPackages = pkgs.linuxPackages_latest;
     loader.systemd-boot.enable = true;
     loader.efi.canTouchEfiVariables = true;
@@ -162,7 +164,6 @@ in lib.fix(self: {
     redshift.enable = true;
     blueman.enable = true;
     mullvad-vpn.enable = true;
-    tlp.enable = true;
     fwupd.enable = true;
     printing.enable = true;
 
@@ -172,6 +173,14 @@ in lib.fix(self: {
       SUBSYSTEM=="i2c-dev", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:08.1/0000:06:00.0/i2c-5/i2c-dev/i2c-5", SYMLINK+="i2c-amdgpu-dm", TAG+="uaccess"
     '';
 
+    # Configure TLP to keep battery charge between 40-70% while
+    # plugged in to the wall (thanks etu for the recommendation).
+    tlp = {
+      enable = true;
+      settings.START_CHARGE_THRESH_BAT0 = 40;
+      settings.STOP_CHARGE_THRESH_BAT0 = 70;
+    };
+
     xserver = {
       enable = true;
       layout = "us";