{
config,
lib,
...
}: let
cfg = config.roles.nvidia;
in {
options.roles.nvidia = {
enable = lib.mkEnableOption "NVIDIA drivers";
};
config = lib.mkIf cfg.enable {
arta.unfree.allow = ["nvidia-x11"];
services.xserver.videoDrivers = ["nvidia"];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
open = true;
nvidiaSettings = false;
};
boot.kernelParams = ["nvidia-drm.fbdev=1"];
};
}