From c3f0c4c68b39249dbfbf8ef26969ad242b0b7cc3 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 21 Dec 2023 18:21:12 +0100 Subject: [PATCH] power-management --- hosts/yodaTab/configuration.nix | 1 + hosts/yodaTux/configuration.nix | 1 + modules/power-management.nix | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 modules/power-management.nix diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index 22be55d..71f395b 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -6,6 +6,7 @@ ../../modules/home-manager.nix ../../modules/nur-and-unstable.nix ../../modules/base.nix + ../../modules/power-management.nix ../../modules/ntfs.nix ../../modules/git.nix ../../modules/zsh.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index f4f6d9c..2d33b7f 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -6,6 +6,7 @@ ../../modules/home-manager.nix ../../modules/nur-and-unstable.nix ../../modules/base.nix + ../../modules/power-management.nix ../../modules/ntfs.nix ../../modules/git.nix ../../modules/zsh.nix diff --git a/modules/power-management.nix b/modules/power-management.nix new file mode 100644 index 0000000..7361a4f --- /dev/null +++ b/modules/power-management.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: +{ + # Power savings. + # Reference: https://www.reddit.com/r/linux/comments/150h0k1/comment/js4p6px/ + + # Whether to enable powertop auto tuning on startup. + # This executes `powertop --auto-tune`. + powerManagement.powertop.enable = true; + + # SCSI link power management policy. The kernel default is “max_performance”. + powerManagement.scsiLinkPolicy = "med_power_with_dipm"; +}