1 { pkgs, lib, config, hostName, ... }:
 
   4   environment.systemPackages = [
 
   8   hardware.nvidia.prime = {
 
  10     #offload.enable = true;
 
  11     intelBusId = "PCI:0:2:0";
 
  12     nvidiaBusId = "PCI:1:0:0";
 
  15   # Load nvidia driver for Xorg and Wayland
 
  16   #services.xserver.videoDrivers = [ "nvidia" ];
 
  17   boot.blacklistedKernelModules = [ "nouveau" ];
 
  20     # Modesetting is required.
 
  21     modesetting.enable = true;
 
  23     # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
 
  24     powerManagement.enable = false;
 
  25     # Fine-grained power management. Turns off GPU when not in use.
 
  26     # Experimental and only works on modern Nvidia GPUs (Turing or newer).
 
  27     powerManagement.finegrained = false;
 
  29     # Use the NVidia open source kernel module (not to be confused with the
 
  30     # independent third-party "nouveau" open source driver).
 
  31     # Support is limited to the Turing and later architectures. Full list of
 
  32     # supported GPUs is at:
 
  33     # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
 
  34     # Only available from driver 515.43.04+
 
  35     # Currently alpha-quality/buggy, so false is currently the recommended setting.
 
  38     # Enable the Nvidia settings menu,
 
  39     # accessible via `nvidia-settings`.
 
  40     nvidiaSettings = true;
 
  42     # Optionally, you may need to select the appropriate driver version for your specific GPU.
 
  43     package = config.boot.kernelPackages.nvidiaPackages.stable;