summaryrefslogtreecommitdiffstats
path: root/modules/hardware
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-08-29 10:42:40 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-08-29 10:42:40 -0400
commit232c3bc6ca183dadb380fb80e9db25ae72565cf8 (patch)
tree97ac99eb2c1f030e0b9fc16d8f0622e6c8c79b72 /modules/hardware
parentb5906d21bbe4cc15ad474397c0e08d4112057af1 (diff)
parent2ea5db7f5d23edb609823c4e3279f980389885cd (diff)
downloadnix-config-232c3bc6ca183dadb380fb80e9db25ae72565cf8.tar.gz
nix-config-232c3bc6ca183dadb380fb80e9db25ae72565cf8.tar.bz2
nix-config-232c3bc6ca183dadb380fb80e9db25ae72565cf8.zip
merge desktop laptop 2026-08-29
Diffstat (limited to 'modules/hardware')
-rw-r--r--modules/hardware/laptop.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/modules/hardware/laptop.nix b/modules/hardware/laptop.nix
new file mode 100644
index 0000000..af8d581
--- /dev/null
+++ b/modules/hardware/laptop.nix
@@ -0,0 +1,40 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ laptopConfig = config.modules.hardware.laptop;
+in {
+ options.modules.hardware.laptop = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = false;
+ };
+ };
+
+ config = lib.mkIf (laptopConfig.enable) {
+ services.thermald.enable = true;
+ services.tlp = {
+ enable = true;
+ settings = {
+ CPU_SCALING_GOVERNOR_ON_AC = "performance";
+ CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
+
+ CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
+ CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
+
+ CPU_MIN_PERF_ON_AC = 0;
+ CPU_MAX_PERF_ON_AC = 100;
+
+ CPU_MIN_PERF_ON_BAT = 0;
+ CPU_MAX_PERF_ON_BAT = 33;
+
+ START_CHARGE_THRESH_BAT0 = 75;
+ STOP_CHARGE_THRESH_BAT0 = 95;
+ };
+ };
+
+ environment.systemPackages = with pkgs; [ xorg.xbacklight ];
+ };
+}