Begin the move to the import all, activate by config model
This commit is contained in:
parent
7397b614de
commit
07cb2d67a2
97 changed files with 776 additions and 633 deletions
|
@ -1,7 +1,9 @@
|
|||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [ ./nvidia ];
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
enable = config.system.desktop.enable;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
vulkan-loader
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nouveau" ];
|
||||
}
|
|
@ -1,10 +1,35 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
open = false;
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue