From 5d5f98ad90b5ce2201dc6ac6f4d008988a3b225b Mon Sep 17 00:00:00 2001 From: Lukas Date: Fri, 20 Feb 2026 13:54:02 +0100 Subject: [PATCH] =?UTF-8?q?apply=20nvidia=20fix=20weil=20diese=20hurens?= =?UTF-8?q?=C3=B6hne=20es=20nicht=20schaffen=20software=20zu=20compilen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/system/nvidia.nix | 44 ++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/modules/system/nvidia.nix b/modules/system/nvidia.nix index 969d86e..c4ab764 100644 --- a/modules/system/nvidia.nix +++ b/modules/system/nvidia.nix @@ -1,20 +1,20 @@ -{config, pkgs, ...}: +{ config, pkgs, ... }: { - nixpkgs.config.allowUnfree = true; + nixpkgs.config.allowUnfree = true; - services.xserver.videoDrivers = ["nvidia"]; - hardware.graphics = { - enable = true; - enable32Bit = true; - }; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.graphics = { + enable = true; + enable32Bit = true; + }; - hardware.nvidia = { + hardware.nvidia = { modesetting.enable = true; # Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Enable this if you have graphical corruption issues or application crashes after waking - # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead # of just the bare essentials. powerManagement.enable = true; @@ -25,7 +25,31 @@ open = false; nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.stable; + package = + let + base = config.boot.kernelPackages.nvidiaPackages.mkDriver { + version = "590.48.01"; + sha256_64bit = "sha256-ueL4BpN4FDHMh/TNKRCeEz3Oy1ClDWto1LO/LWlr1ok="; + openSha256 = "sha256-hECHfguzwduEfPo5pCDjWE/MjtRDhINVr4b1awFdP44="; + settingsSha256 = "sha256-4SfCWp3swUp+x+4cuIZ7SA5H7/NoizqgPJ6S9fm90fA="; + persistencedSha256 = ""; + }; + cachyos-nvidia-patch = pkgs.fetchpatch { + url = "https://raw.githubusercontent.com/CachyOS/CachyOS-PKGBUILDS/master/nvidia/nvidia-utils/kernel-6.19.patch"; + sha256 = "sha256-YuJjSUXE6jYSuZySYGnWSNG5sfVei7vvxDcHx3K+IN4="; + }; + + # Patch the appropriate driver based on config.hardware.nvidia.open + driverAttr = if config.hardware.nvidia.open then "open" else "bin"; + in + base + // { + ${driverAttr} = base.${driverAttr}.overrideAttrs (oldAttrs: { + patches = (oldAttrs.patches or [ ]) ++ [ cachyos-nvidia-patch ]; + }); + }; + + # package = config.boot.kernelPackages.nvidiaPackages.unstable; }; }