[nvidia] Update settings

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

View file

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

View file

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