feat: fix nvidia lates driver not building on kernel 6.19
This commit is contained in:
parent
0f5396ace9
commit
7367a57778
1 changed files with 20 additions and 0 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue