2021-05-11 04:31:41 -04:00
|
|
|
{ lib, pkgs, modulesPath, ... }:
|
2017-09-24 10:19:52 -04:00
|
|
|
|
2017-12-24 07:16:10 -05:00
|
|
|
{
|
|
|
|
imports = [
|
2017-12-24 18:21:05 -05:00
|
|
|
../.
|
|
|
|
../../../common/pc/laptop/ssd
|
2021-05-11 04:31:41 -04:00
|
|
|
"${modulesPath}/hardware/network/broadcom-43xx.nix"
|
2017-12-24 07:16:10 -05:00
|
|
|
];
|
2017-09-24 10:19:52 -04:00
|
|
|
|
2020-12-01 03:57:29 -05:00
|
|
|
powerManagement = {
|
2020-12-01 07:42:01 -05:00
|
|
|
# Enable gradually increasing/decreasing CPU frequency, rather than using
|
2020-12-01 03:57:29 -05:00
|
|
|
# "powersave", which would keep CPU frequency at 0.8GHz.
|
|
|
|
cpuFreqGovernor = lib.mkDefault "conservative";
|
|
|
|
|
|
|
|
# brcmfmac being loaded during hibernation would not let a successful resume
|
2020-12-01 07:42:01 -05:00
|
|
|
# https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116.
|
|
|
|
# Also brcmfmac could randomly crash on resume from sleep.
|
2020-12-01 03:57:29 -05:00
|
|
|
powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac";
|
|
|
|
powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac";
|
|
|
|
};
|
|
|
|
|
2017-12-24 07:16:10 -05:00
|
|
|
# USB subsystem wakes up MBP right after suspend unless we disable it.
|
|
|
|
services.udev.extraRules = lib.mkDefault ''
|
2017-09-24 10:19:52 -04:00
|
|
|
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"
|
|
|
|
'';
|
|
|
|
}
|