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