From 52a2557c254b27462e2af162313797779fdbd3eb Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Thu, 15 Jul 2021 09:25:06 -0400 Subject: [PATCH] Update the NVIDIA module for unstable --- README.org | 11 +++++++++-- modules/nvidia.nix | 9 ++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 9c7f689..ca3b8f3 100644 --- a/README.org +++ b/README.org @@ -68,7 +68,7 @@ sudo nixos-rebuild switch --rollback ** Docker Container -It's possible to use parts of this configuration using the container. By default, sandboxing is turned /off/ inside of the container, even though it's enabled in new installations. This can lead to differences between derivations built inside containers, versus those built without any containerization. This is especially true if a derivation relies on sandboxing to block sideloading of dependencies. +It's possible to use parts of this configuration using a container. By default, sandboxing is turned /off/ inside of the container, even though it's enabled in new installations. This can lead to differences between derivations built inside containers, versus those built without any containerization. This is especially true if a derivation relies on sandboxing to block sideloading of dependencies. #+BEGIN_SRC conf :tangle Dockerfile # Derive from the official image. @@ -1164,7 +1164,14 @@ in { }; # Enable the NVIDIA drivers. - services.xserver.videoDrivers = [ "modesetting" "nvidia" ]; + services.xserver.videoDrivers = [ "nvidia" ]; + + # Fix screen tearing. + services.xserver.screenSection = '' + Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}" + Option "AllowIndirectGLXProtocol" "off" + Option "TripleBuffer" "on" + ''; # Configure `offload-mode'. hardware.nvidia.prime = { diff --git a/modules/nvidia.nix b/modules/nvidia.nix index eb291c9..a3738a2 100644 --- a/modules/nvidia.nix +++ b/modules/nvidia.nix @@ -22,7 +22,14 @@ in { }; # Enable the NVIDIA drivers. - services.xserver.videoDrivers = [ "modesetting" "nvidia" ]; + services.xserver.videoDrivers = [ "nvidia" ]; + + # Fix screen tearing. + services.xserver.screenSection = '' + Option "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}" + Option "AllowIndirectGLXProtocol" "off" + Option "TripleBuffer" "on" + ''; # Configure `offload-mode'. hardware.nvidia.prime = {