From 1524f1fdb9c18720292db04f47c5f926a8023707 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 4 Dec 2026 01:36:22 +0000 Subject: x11: nvidia From the dirt. --- configs/x11/xserver.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/configs/x11/xserver.nix b/configs/x11/xserver.nix index 816ffbc8..dcc0821a 100644 --- a/configs/x11/xserver.nix +++ b/configs/x11/xserver.nix @@ -116,6 +116,9 @@ in { (pkgs.writeDashBin "xinit" '' set -efu + # For the nvidia driver's libraries. + export LD_LIBRARY_PATH=/run/opengl-driver/lib:/run/opengl-driver-32/lib + tty=$(${pkgs.coreutils}/bin/tty) i=''${tty#/dev/tty} @@ -151,6 +154,16 @@ in { Section.Device.GPU.Driver = "amdgpu"; }; } + // lib.optionalAttrs + (lib.any (pkg: pkg.pname == "nvidia-x11") config.services.xserver.modules) + { + "10-nvidia-x11.conf" = { + Section.Device.GPU = { + Driver = "nvidia"; + Option.SidebandSocketPath = "/run/nvidia-xdriver/"; + }; + }; + } // { "10-base.conf" = { Section.ServerFlags.default.Option.DontZap = true; -- cgit v1.3.1