{ lib, config, ... }: let inherit (lib) mkEnableOption mkIf mkForce; cfg = config.marleyos.nvidia; in { options.marleyos.nvidia.enable = mkEnableOption "nvidia"; config = mkIf cfg.enable { # NVIDIA drivers are unfree. nixpkgs.config.allowUnfree = mkForce true; # 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; }; }; }; }