nixos-config/modules/nixos/graphics.nix
2026-05-19 12:38:07 +02:00

27 lines
582 B
Nix

{ lib, config, ... }:
with lib;
let
cfg = config.modules.graphics;
in
{
options.modules.graphics = {
enable = mkEnableOption "graphics";
# TODO: Add toggle for hybrid graphics
};
config = mkIf cfg.enable {
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
services.xserver.videoDrivers = [ "nvidia" ];
# TODO: Add nvidia settings back in
# TODO: Move to nvidia module
hardware.nvidia = {
open = false;
prime = {
intelBusId = "PCI:0@0:2:0";
nvidiaBusId = "PCI:1@0:0:0";
};
};
};
}