marleyos/modules/nixos/nvidia/default.nix

33 lines
608 B
Nix
Raw Permalink Normal View History

2025-01-09 08:08:30 -08:00
{
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;
};
};
};
}