2023-11-20 15:24:27 +01:00
|
|
|
{ lib, pkgs, ... }: {
|
2023-11-01 18:55:37 +01:00
|
|
|
imports = [ ../../../../common/gpu/nvidia/prime.nix ];
|
2023-09-28 11:31:15 +02:00
|
|
|
|
2023-11-20 15:35:37 +01:00
|
|
|
#D-Bus service to check the availability of dual-GPU
|
|
|
|
services.switcherooControl.enable = lib.mkDefault true;
|
|
|
|
|
2023-11-01 18:55:37 +01:00
|
|
|
hardware = {
|
|
|
|
nvidia = {
|
|
|
|
prime = {
|
|
|
|
# Bus ID of the Intel GPU.
|
|
|
|
intelBusId = lib.mkDefault "PCI:0:2:0";
|
|
|
|
# Bus ID of the NVIDIA GPU.
|
|
|
|
nvidiaBusId = lib.mkDefault "PCI:1:0:0";
|
|
|
|
};
|
2023-11-20 15:24:27 +01:00
|
|
|
powerManagement = {
|
|
|
|
# Enable NVIDIA power management.
|
|
|
|
enable = lib.mkDefault true;
|
|
|
|
|
|
|
|
# Enable dynamic power management.
|
|
|
|
finegrained = lib.mkDefault true;
|
|
|
|
};
|
2023-11-01 18:55:37 +01:00
|
|
|
};
|
|
|
|
opengl = {
|
|
|
|
enable = lib.mkDefault true;
|
|
|
|
driSupport32Bit = lib.mkDefault true;
|
|
|
|
extraPackages = with pkgs; [ intel-media-driver intel-compute-runtime ];
|
|
|
|
};
|
2023-09-28 11:31:15 +02:00
|
|
|
};
|
|
|
|
}
|