{ lib, config, pkgs, ... }: with lib; { options.hwAccelerationGPU = mkOption { type = types.nullOr (types.enum [ "nvidia" "intel" ]); default = null; example = "nvidia"; description = '' The GPU type. ''; }; config = { hardware.opengl = { enable = config.hwAccelerationGPU != null; extraPackages = with pkgs; [ (mkIf (config.hwAccelerationGPU == "intel") intel-media-driver) libvdpau-va-gl vaapiVdpau ]; }; services.xserver.videoDrivers = [ (mkIf (config.hwAccelerationGPU == "nvidia") "nouveau") ]; }; }