36 lines
1.2 KiB
Nix
36 lines
1.2 KiB
Nix
{ lib, pkgs, config, ... }:
|
|
{
|
|
options.system.video = {
|
|
nvidia = {
|
|
enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = "Enable the proprietary Nvidia stack";
|
|
};
|
|
};
|
|
nouveau = {
|
|
enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = "Enable the open-source Nouveau driver";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = {
|
|
# Conditionally set video drivers based on the options
|
|
services.xserver.videoDrivers =
|
|
if config.system.video.nvidia.enable then [ "nvidia" ]
|
|
else if config.system.video.nouveau.enable then [ "nouveau" ]
|
|
else [];
|
|
|
|
# Configure Nvidia settings if Nvidia is enabled
|
|
hardware.nvidia = lib.mkIf config.system.video.nvidia.enable {
|
|
modesetting.enable = true;
|
|
nvidiaSettings = false;
|
|
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
|
open = false;
|
|
};
|
|
};
|
|
}
|