nixos-config/modules/nixos/system/hardware/gpu/nvidia/default.nix

29 lines
626 B
Nix

{ lib, config, ... }:
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.graphics = {
enable = true;
enable32Bit = true;
};
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.beta; # stable, beta
};
services.xserver.videoDrivers = [ "nvidia" ];
};
}