mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 09:17:14 +08:00 
			
		
		
		
	Add a config for Asus Zephyrus GA402X* (2023) series
- Disable power-saving for the keyboard on the Asus Zephyrus GA402X series (2023) - Add more-aggressive roaming rules for Asus Mediatek cards when using IWD - Add note about potentially needing more-aggressive roaming rules for Asus Mediatek cards when using WPA-Supplicant - Make enabling the higher scanning optional - Split-up the AMD-GPU and Nvidia configs - Add switch for AMD-GPU recovery mode - Add switch for AMD-GPU sg_display (Scatter/Gather) mode - Add switch for AMD-GPU PSR support
This commit is contained in:
		
							
								
								
									
										55
									
								
								asus/zephyrus/ga402x/nvidia/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								asus/zephyrus/ga402x/nvidia/default.nix
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
{ lib,
 | 
			
		||||
  pkgs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  inherit (lib) mkDefault;
 | 
			
		||||
 | 
			
		||||
in {
 | 
			
		||||
  imports = [
 | 
			
		||||
    ../shared.nix
 | 
			
		||||
    ## "prime.nix" loads this, aleady:
 | 
			
		||||
    # ../../../common/gpu/nvidia
 | 
			
		||||
    ../../../../common/gpu/nvidia/prime.nix
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  # NVIDIA GeForce RTX 4060 Mobile
 | 
			
		||||
 | 
			
		||||
  boot = {
 | 
			
		||||
    blacklistedKernelModules = [ "nouveau" ];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  # Also in nvidia/default.nix
 | 
			
		||||
  services.xserver.videoDrivers = mkDefault [ "nvidia" ];
 | 
			
		||||
 | 
			
		||||
  hardware = {
 | 
			
		||||
    ## Enable the Nvidia card, as well as Prime and Offload:
 | 
			
		||||
    amdgpu.loadInInitrd = true;
 | 
			
		||||
    opengl.extraPackages = with pkgs; [
 | 
			
		||||
      # Also in nvidia/default.nix
 | 
			
		||||
      vaapiVdpau
 | 
			
		||||
      libvdpau-va-gl
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
    nvidia = {
 | 
			
		||||
      modesetting.enable = true;
 | 
			
		||||
      nvidiaSettings = true;
 | 
			
		||||
 | 
			
		||||
      prime = {
 | 
			
		||||
        offload = {
 | 
			
		||||
          enable = true;
 | 
			
		||||
          enableOffloadCmd = true;
 | 
			
		||||
        };
 | 
			
		||||
        amdgpuBusId = "PCI:101:0:0";
 | 
			
		||||
        nvidiaBusId = "PCI:1:0:0";
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      powerManagement = {
 | 
			
		||||
        # This is unreliable on the 4060;  works a few times, then hangs:
 | 
			
		||||
        # enable = true;
 | 
			
		||||
        # finegrained = true
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user