global(gui): add pure nvidia flicker workaround

This commit is contained in:
514fpv 2024-01-19 21:59:46 +08:00
parent a2dfd20cb1
commit ebe904e9f6
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw

View file

@ -41,7 +41,9 @@ in {
vaapiVdpau vaapiVdpau
libvdpau-va-gl libvdpau-va-gl
intel-compute-runtime intel-compute-runtime
] ++ optional nvidia nvidia-vaapi-driver; ] ++
optional nvidia nvidia-vaapi-driver ++
optional (cfg.type == "nvidia") vulkan-validation-layers;
}; };
services.xserver.videoDrivers = services.xserver.videoDrivers =
@ -66,8 +68,12 @@ in {
open = false; open = false;
}; };
environment.variables = {
# work around broken nvidia hw cursor on wayland # work around broken nvidia hw cursor on wayland
environment.variables.WLR_NO_HARDWARE_CURSORS = mkIf (cfg.type == "nvidia") "1"; WLR_NO_HARDWARE_CURSORS = mkIf (cfg.type == "nvidia") "1";
# work around wlroots flickering on pure nvidia
WLR_RENDERER = mkIf (cfg.type == "nvidia") "vulkan";
};
specialisation.integratedGraphics = mkIf (cfg.type == "prime") { specialisation.integratedGraphics = mkIf (cfg.type == "prime") {
configuration = { configuration = {