move nvidia relevant options into one file
This commit is contained in:
parent
3a60431e41
commit
6d3d822ab0
2 changed files with 39 additions and 20 deletions
35
modules/nixos/system/hardware/gpu/nvidia/default.nix
Normal file
35
modules/nixos/system/hardware/gpu/nvidia/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.wyrdgard; let
|
||||
cfg = config.wyrdgard.system.hardware.gpu.nvidia;
|
||||
in {
|
||||
options.wyrdgard.system.hardware.gpu.nvidia = with types; {
|
||||
enable = mkEnableOption "Enable Nvidia GPU";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = false;
|
||||
powerManagement.finegrained = false;
|
||||
open = false;
|
||||
nvidiaSettings = false;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta; # stable, beta
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
services.xserver.displayManager.sddm.wayland.enable = lib.mkForce false;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue