# NVIDIA for host desktop (disabled when GPU passthrough binds the card to VFIO).
{ config, lib, pkgs, ... }:
lib.mkIf (!config.chiasson.system.gpuPassthru.enable) {
  boot.kernelParams = [ "snd_hda_core.gpu_bind=0" ];
  boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;

  services.xserver.videoDrivers = [ "nvidia" ];

  hardware.nvidia = {
    modesetting.enable = true;
    powerManagement.enable = false;
    powerManagement.finegrained = false;
    open = true;
    nvidiaSettings = true;
    package = config.boot.kernelPackages.nvidiaPackages.latest;
  };

  hardware.nvidia-container-toolkit.enable = true;
}
