feat(hardware): add gpu modules for intel/amd/nvidia
This commit is contained in:
		
							parent
							
								
									eb93983bfe
								
							
						
					
					
						commit
						8f229750b0
					
				
					 4 changed files with 136 additions and 0 deletions
				
			
		
							
								
								
									
										29
									
								
								system/modules/hardware/gpu/amd/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								system/modules/hardware/gpu/amd/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
{ config, lib, pkgs, ... }:
 | 
			
		||||
 | 
			
		||||
let
 | 
			
		||||
  gpu = config.systemModules.hardware.gpu;
 | 
			
		||||
  inherit (lib) mkIf mkDefault;
 | 
			
		||||
  inherit (builtins) elem;
 | 
			
		||||
in
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  config = mkIf (elem gpu.type ["amd"]) {
 | 
			
		||||
    hardware.opengl = {
 | 
			
		||||
      extraPackages = with pkgs; [
 | 
			
		||||
        vulkan-tools
 | 
			
		||||
        vulkan-loader
 | 
			
		||||
        vulkan-extension-layer
 | 
			
		||||
        vulkan-validation-layer
 | 
			
		||||
        amdvlk
 | 
			
		||||
        mesa
 | 
			
		||||
      ];
 | 
			
		||||
      extraPackages32 = [ pkgs.driversi686Linux.amdvlk ];
 | 
			
		||||
      boot = {
 | 
			
		||||
        initrd.kernelModules = ["amdgpu"];
 | 
			
		||||
        kernelModules = ["amdgpu"];
 | 
			
		||||
      };
 | 
			
		||||
      environment.systemPackages = [ pkgs.nvtopPackages.amd ];
 | 
			
		||||
      services.xserver.videoDrivers = mkDefault ["modesetting" "amdgpu"];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue