Update to 24.11
This commit is contained in:
parent
79310cc53a
commit
81baaf8391
17 changed files with 94 additions and 80 deletions
|
@ -1,10 +1,13 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [ ./nvidia ];
|
||||
imports = [
|
||||
./nvidia
|
||||
./nouveau
|
||||
];
|
||||
|
||||
hardware.opengl = {
|
||||
hardware.graphics = {
|
||||
enable = config.system.desktop.enable;
|
||||
driSupport32Bit = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
|
|
15
modules/system/devices/video/nouveau/default.nix
Normal file
15
modules/system/devices/video/nouveau/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
options.system.video.nouveau = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable the open-source Nouveau driver";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.system.video.nouveau.enable {
|
||||
services.xserver.videoDrivers = [ "nouveau" ];
|
||||
boot.kernelParams = [ "nouveau.config=NvGspRm=1" ];
|
||||
};
|
||||
}
|
|
@ -1,30 +1,14 @@
|
|||
{ 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";
|
||||
};
|
||||
options.system.video.nvidia = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable the proprietary Nvidia stack";
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
config = lib.mkIf config.system.video.nvidia.enable {
|
||||
hardware = {
|
||||
nvidia = lib.mkIf config.system.video.nvidia.enable {
|
||||
modesetting.enable = true;
|
||||
|
@ -32,7 +16,10 @@
|
|||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = false;
|
||||
};
|
||||
opengl.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
|
||||
graphics.extraPackages = with pkgs; [ nvidia-vaapi-driver ];
|
||||
};
|
||||
|
||||
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue