Graphics module rather than Nvidia specific module
I❤ nvidia...
This commit is contained in:
parent
129debbdb1
commit
aed273b46a
3 changed files with 32 additions and 28 deletions
31
modules/graphics.nix
Normal file
31
modules/graphics.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let cfg = config.voidcruiser.graphics;
|
||||
in {
|
||||
options.voidcruiser.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"];
|
||||
};
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let cfg = config.voidcruiser.nvidia;
|
||||
in {
|
||||
options.voidcruiser.nvidia = {
|
||||
enable = mkEnableOption "Enables proprietary Nvidia drivers and related config";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
hardware = {
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
powerManagement = {
|
||||
enable = false;
|
||||
finegrained = false;
|
||||
};
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
};
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue