2025-01-09 08:08:30 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.marleyos.nvidia;
|
|
|
|
in {
|
2025-01-13 21:05:10 -08:00
|
|
|
options.marleyos.nvidia.enable = lib.mkEnableOption "nvidia";
|
2025-01-09 08:08:30 -08:00
|
|
|
|
2025-01-13 21:05:10 -08:00
|
|
|
config = lib.mkIf cfg.enable {
|
2025-01-09 08:08:30 -08:00
|
|
|
# NVIDIA drivers are unfree.
|
2025-01-13 21:05:10 -08:00
|
|
|
nixpkgs.config.allowUnfree = lib.mkForce true;
|
2025-01-09 08:08:30 -08:00
|
|
|
|
|
|
|
# Load drivers for Xorg and Wayland.
|
|
|
|
services.xserver.videoDrivers = ["nvidia"];
|
|
|
|
|
|
|
|
hardware = {
|
|
|
|
# openGL.
|
|
|
|
graphics.enable = true;
|
|
|
|
|
|
|
|
nvidia = {
|
|
|
|
modesetting.enable = true;
|
|
|
|
nvidiaSettings = true;
|
|
|
|
|
|
|
|
# Disable open-source drivers.
|
|
|
|
open = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|