[nvidia] Update settings

This commit is contained in:
Tibo De Peuter 2023-10-24 12:45:40 +02:00
parent 698876102e
commit 99231d0d04
2 changed files with 19 additions and 6 deletions

View file

@ -10,7 +10,7 @@
users.tdpeuter.enable = true;
hardware.nvidia.enable = true;
hardware.nvidia.model = "T2000";
hardware.nvidia.model = "Quadro T2000";
programs = {
home-manager.enable = true;

View file

@ -14,25 +14,38 @@ in {
options.sisyphus.hardware.nvidia = {
enable = lib.mkEnableOption "NVIDIA GPU support";
model = lib.mkOption {
type = lib.types.enum [ "" "T2000" "RTX 2060" ];
type = lib.types.enum [ "" "Quadro T2000" "RTX 2060" ];
default = "";
example = "T2000";
example = "Quadro T2000";
description = lib.mdDoc "The model of NVIDIA GPU card";
};
gui-settings = lib.mkEnableOption "NVIDIA settings menu";
};
config = lib.mkIf cfg.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
opengl.enable = true;
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = {
open = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
modesetting.enable = true;
nvidiaSettings = config.sisyphus.hardware.nvidia.gui-settings;
powerManagement = {
enable = true;
finegrained = true;
};
prime = lib.mkIf (cfg.model == "T2000") {
offload.enable = true;
prime = lib.mkIf (cfg.model == "Quadro T2000") {
offload = {
enable = true;
enableOffloadCmd = true;
};
intelBusId = "PCI::00:02:0";
nvidiaBusId = "PCI:01:00:0";
};