mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	apple/macbook-pro/12-1: PM: set cpuFreqGovernor and power Up/Down commands (#214)
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
{ lib, ... }:
 | 
			
		||||
{ lib, pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  imports = [
 | 
			
		||||
@@ -7,6 +7,17 @@
 | 
			
		||||
    <nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  powerManagement = {
 | 
			
		||||
    # enable gradually increasing/decreasing CPU frequency, rather than using
 | 
			
		||||
    # "powersave", which would keep CPU frequency at 0.8GHz.
 | 
			
		||||
    cpuFreqGovernor = lib.mkDefault "conservative";
 | 
			
		||||
 | 
			
		||||
    # brcmfmac being loaded during hibernation would not let a successful resume
 | 
			
		||||
    # https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116
 | 
			
		||||
    powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac";
 | 
			
		||||
    powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac";
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # USB subsystem wakes up MBP right after suspend unless we disable it.
 | 
			
		||||
  services.udev.extraRules = lib.mkDefault ''
 | 
			
		||||
    SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user