feat: fix nvidia lates driver not building on kernel 6.19

This commit is contained in:
CronyAkatsuki 2026-02-15 13:35:16 +01:00
parent 0f5396ace9
commit 7367a57778

View file

@ -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;
};