nixos-config/modules/power.nix

20 lines
414 B
Nix
Raw Normal View History

2019-08-27 23:41:02 +04:00
{ config, pkgs, lib, ... }:
with rec {
inherit (config) device deviceSpecific;
2019-08-27 23:41:02 +04:00
};
with deviceSpecific; {
services.tlp = {
2019-08-27 23:41:02 +04:00
enable = isLaptop;
extraConfig = ''
# To avoid filesystem corruption on btrfs formatted partitions
SATA_LINKPWR_ON_BAT=max_performance
'';
2019-08-27 23:41:02 +04:00
};
services.undervolt = {
enable = (device == "Dell-Laptop");
coreOffset = "-120";
gpuOffset = "-54";
}
2019-08-27 23:41:02 +04:00
}