From ef69b2f41448ba70b55e93dd3d81699b69795344 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 13 Aug 2023 19:01:42 +0300 Subject: [PATCH] add screen tearing fix to modules/nvidia --- modules/hardware/nvidia/default.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/modules/hardware/nvidia/default.nix b/modules/hardware/nvidia/default.nix index 5dbcb878..5b29233e 100644 --- a/modules/hardware/nvidia/default.nix +++ b/modules/hardware/nvidia/default.nix @@ -1,9 +1,14 @@ -{ outputs, options, config, lib, pkgs, ...}: -with lib; -let - cfg = config.modules.hardware.nvidia; -in { + outputs, + options, + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.modules.hardware.nvidia; +in { options.modules.hardware.nvidia = { enable = mkEnableOption false; }; @@ -13,12 +18,12 @@ in enable = true; driSupport = true; driSupport32Bit = true; - }; + }; - # regardless of if you have intel/nvidia + # regardless of if you have intel/nvidia # or amd/nvidia this HAS to be nvidia only # or else it will not work - services.xserver.videoDrivers = [ "nvidia" ]; + services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { # wayland support @@ -32,6 +37,10 @@ in # settings nvidiaSettings = true; + # screen tearing fix + # might break a few things, don't really know + forceFullCompositionPipeline = true; + # Package package = config.boot.kernelPackages.nvidiaPackages.stable;