From 7367a57778ef40a34bfb1628778cbc4bda3ee1b2 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Sun, 15 Feb 2026 13:35:16 +0100 Subject: [PATCH] feat: fix nvidia lates driver not building on kernel 6.19 --- hosts/skadi/configuration.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hosts/skadi/configuration.nix b/hosts/skadi/configuration.nix index 076664f..38ed2a2 100644 --- a/hosts/skadi/configuration.nix +++ b/hosts/skadi/configuration.nix @@ -68,6 +68,26 @@ hardware.nvidia = { modesetting.enable = true; open = true; + # Apply CachyOS kernel 6.19 patch to NVIDIA latest driver + package = let + base = config.boot.kernelPackages.nvidiaPackages.latest; + 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]; + }); + }; nvidiaSettings = true; powerManagement.enable = true; };