From 444a1955d92218bc6544e7fd53c889caaeda29b2 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Sun, 23 Feb 2025 11:20:30 -0600 Subject: [PATCH] Add laptop role and set up TLP. --- hosts/flynode/default.nix | 1 + roles/laptop.nix | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 roles/laptop.nix diff --git a/hosts/flynode/default.nix b/hosts/flynode/default.nix index c4474a7..7ff9cda 100644 --- a/hosts/flynode/default.nix +++ b/hosts/flynode/default.nix @@ -5,6 +5,7 @@ { imports = [ ./hardware-configuration.nix + ../../roles/laptop.nix ../../roles/zfs.nix ../../base.nix ../../users/root.nix diff --git a/roles/laptop.nix b/roles/laptop.nix new file mode 100644 index 0000000..ca77dd6 --- /dev/null +++ b/roles/laptop.nix @@ -0,0 +1,12 @@ +{ + services.tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge + STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging + }; + }; + powerManagement.enable = true; +}