mirror of
				https://github.com/NixOS/nixos-hardware.git
				synced 2025-11-04 17:27:14 +08:00 
			
		
		
		
	Made modifications related to AMD CPU and nvidia GPU changes
This commit is contained in:
		@@ -1,21 +1,45 @@
 | 
				
			|||||||
{ lib, pkgs, ... }:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    imports = [
 | 
					  lib,
 | 
				
			||||||
      ../../common/cpu/amd
 | 
					  pkgs,
 | 
				
			||||||
      ../../common/cpu/amd/raphael/igpu.nix
 | 
					  config,
 | 
				
			||||||
      ../../common/cpu/amd/pstate.nix
 | 
					  ...
 | 
				
			||||||
      ../../common/gpu/nvidia
 | 
					}: {
 | 
				
			||||||
      ../../common/gpu/nvidia/prime-sync.nix
 | 
					  imports = [
 | 
				
			||||||
      ../../common/hidpi.nix
 | 
					    ../../common/cpu/amd
 | 
				
			||||||
      ../../common/pc/laptop
 | 
					    ../../common/cpu/amd/raphael/igpu.nix
 | 
				
			||||||
      ../../common/pc/ssd
 | 
					    ../../common/cpu/amd/pstate.nix
 | 
				
			||||||
    ];
 | 
					    ../../common/gpu/nvidia
 | 
				
			||||||
 | 
					    ../../common/gpu/nvidia/prime.nix
 | 
				
			||||||
 | 
					    ../../common/hidpi.nix
 | 
				
			||||||
 | 
					    ../../common/pc/laptop
 | 
				
			||||||
 | 
					    ../../common/pc/ssd
 | 
				
			||||||
 | 
					    ../battery.nix
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") pkgs.linuxPackages_latest;
 | 
					  boot.kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") pkgs.linuxPackages_latest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    hardware.nvidia.prime = {
 | 
					  # The bottom 2 parts are taken from the framework 16-inch laptops configurations.
 | 
				
			||||||
      amdgpuBusId = "PCI:54:0:0";
 | 
					  # Workaround for SuspendThenHibernate: https://lore.kernel.org/linux-kernel/20231106162310.85711-1-mario.limonciello@amd.com/
 | 
				
			||||||
      nvidiaBusId = "PCI:1:0:0";
 | 
					  boot.kernelParams = lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") ["rtc_cmos.use_acpi_alarm=1"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # AMD has better battery life with PPD over TLP:
 | 
				
			||||||
 | 
					  # https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
 | 
				
			||||||
 | 
					  services.power-profiles-daemon.enable = lib.mkDefault true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Adds the missing asus functionality to Linux.
 | 
				
			||||||
 | 
					  # https://asus-linux.org/manual/asusctl-manual/
 | 
				
			||||||
 | 
					  services = {
 | 
				
			||||||
 | 
					    asusd = {
 | 
				
			||||||
 | 
					      enable = lib.mkDefault true;
 | 
				
			||||||
 | 
					      enableUserService = lib.mkDefault true;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  }
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  hardware.nvidia.prime = {
 | 
				
			||||||
 | 
					    modesetting.enable = lib.mkDefault true;
 | 
				
			||||||
 | 
					    open = lib.mkDefault false;
 | 
				
			||||||
 | 
					    nvidiaSettings = lib.mkDefault true;
 | 
				
			||||||
 | 
					    amdgpuBusId = "PCI:54:0:0";
 | 
				
			||||||
 | 
					    nvidiaBusId = "PCI:1:0:0";
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user