NixOS-Config/modules/system/devices/video/nvidia/default.nix
2024-11-19 13:20:34 -05:00

26 lines
699 B
Nix

{ lib, pkgs, config, ... }:
{
options.system.video.nvidia = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable the proprietary Nvidia stack";
};
};
config = lib.mkIf config.system.video.nvidia.enable {
hardware = {
nvidia = lib.mkIf config.system.video.nvidia.enable {
modesetting.enable = true;
nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages.beta;
open = false;
};
graphics.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
};
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
services.xserver.videoDrivers = [ "nvidia" ];
};
}