Added power
This commit is contained in:
		
							parent
							
								
									5627d042f1
								
							
						
					
					
						commit
						eb246e67b2
					
				
							
								
								
									
										18
									
								
								modules/system/power.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								modules/system/power.nix
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,18 @@
 | 
				
			||||||
 | 
					{ config, lib, pkgs, ... }:
 | 
				
			||||||
 | 
					let cfg = config.this.system.power;
 | 
				
			||||||
 | 
					in with lib; {
 | 
				
			||||||
 | 
					  options.this.system.power.enable = mkEnableOption "Power Management";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  config = mkIf cfg.enable {
 | 
				
			||||||
 | 
					    # fan control modules
 | 
				
			||||||
 | 
					    boot.extraModprobeConfig = ''
 | 
				
			||||||
 | 
					      options thinkpad_acpi fan_control=1 experimental=1
 | 
				
			||||||
 | 
					    '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # battery optimizations
 | 
				
			||||||
 | 
					    powerManagement.powertop.enable = true;
 | 
				
			||||||
 | 
					    services.upower.enable = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    environment.systemPackages = with pkgs; [ powertop ];
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user