voidconf/modules/graphics.nix

32 lines
897 B
Nix
Raw Permalink Normal View History

{ lib, config, ... }:
with lib;
2024-02-17 18:49:37 +01:00
let cfg = config.voidconf.graphics;
in {
2024-02-17 18:49:37 +01:00
options.voidconf.graphics ={
defaultSettings.enable = mkEnableOption "Enables some basic graphical settings";
nvidia = {
enable = mkEnableOption "Enables Nvidia settings";
proprietaryDrivers = mkEnableOption "Enables proprietary drivers";
};
};
config = {
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = mkIf cfg.nvidia.enable {
package = config.boot.kernelPackages.nvidiaPackages.stable;
powerManagement = {
enable = false;
finegrained = false;
};
open = !cfg.nvidia.proprietaryDrivers;
nvidiaSettings = cfg.nvidia.proprietaryDrivers;
};
};
services.xserver.videoDrivers = mkIf cfg.nvidia.proprietaryDrivers ["nvidia"];
};
}