mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	conditionally turn on power management and modesetting when we are in sync mode
This commit is contained in:
		@@ -1,5 +1,4 @@
 | 
			
		||||
{ lib, ... }:
 | 
			
		||||
{
 | 
			
		||||
{ lib, config, ... }: {
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../../../common/gpu/nvidia.nix
 | 
			
		||||
    ../../../common/cpu/intel
 | 
			
		||||
@@ -25,9 +24,21 @@
 | 
			
		||||
  # required to make wireless work
 | 
			
		||||
  hardware.enableAllFirmware = lib.mkDefault true;
 | 
			
		||||
 | 
			
		||||
  # fix suspend/resume screen corruption
 | 
			
		||||
  #hardware.nvidia.powerManagement.enable = true;
 | 
			
		||||
  
 | 
			
		||||
  # fix suspend/resume screen corruption in sync mode
 | 
			
		||||
  hardware.nvidia.powerManagement =
 | 
			
		||||
    lib.mkIf config.hardware.nvidia.prime.sync.enable {
 | 
			
		||||
      enable = lib.mkDefault true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  # fix screen tearing in sync mode
 | 
			
		||||
  hardware.nvidia.modesetting =
 | 
			
		||||
    lib.mkIf config.hardware.nvidia.prime.sync.enable {
 | 
			
		||||
      enable = lib.mkDefault true;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
  # silence ACPI "errors" at boot shown before NixOS stage 1 output (default is 4)
 | 
			
		||||
  #boot.consoleLogLevel = 3;
 | 
			
		||||
 | 
			
		||||
  # throttled vs. thermald
 | 
			
		||||
  # -----------------------
 | 
			
		||||
  #
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user