2020-12-01 08:57:29 +00:00
|
|
|
{ lib, pkgs, ... }:
|
2017-09-24 14:19:52 +00:00
|
|
|
|
2017-12-24 12:16:10 +00:00
|
|
|
{
|
|
|
|
imports = [
|
2017-12-24 23:21:05 +00:00
|
|
|
../.
|
|
|
|
../../../common/pc/laptop/ssd
|
2017-12-24 12:16:10 +00:00
|
|
|
<nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>
|
|
|
|
];
|
2017-09-24 14:19:52 +00:00
|
|
|
|
2020-12-01 08:57:29 +00:00
|
|
|
powerManagement = {
|
2020-12-01 12:42:01 +00:00
|
|
|
# Enable gradually increasing/decreasing CPU frequency, rather than using
|
2020-12-01 08:57:29 +00: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 12:42:01 +00:00
|
|
|
# https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116.
|
|
|
|
# Also brcmfmac could randomly crash on resume from sleep.
|
2020-12-01 08:57:29 +00:00
|
|
|
powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac";
|
|
|
|
powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac";
|
|
|
|
};
|
|
|
|
|
2017-12-24 12:16:10 +00:00
|
|
|
# USB subsystem wakes up MBP right after suspend unless we disable it.
|
|
|
|
services.udev.extraRules = lib.mkDefault ''
|
2017-09-24 14:19:52 +00:00
|
|
|
SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"
|
|
|
|
'';
|
|
|
|
}
|