mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-13 16:12:40 +02:00
fix: linux 6.19 works not well with nvidia driver
This commit is contained in:
@@ -41,8 +41,7 @@
|
|||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/top-level/linux-kernels.nix
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/top-level/linux-kernels.nix
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_6_18; # 6.19 works not well with nvidia driver
|
||||||
# boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [
|
||||||
"xhci_pci"
|
"xhci_pci"
|
||||||
|
|||||||
@@ -27,24 +27,7 @@
|
|||||||
# package = config.boot.kernelPackages.nvidiaPackages.production;
|
# package = config.boot.kernelPackages.nvidiaPackages.production;
|
||||||
|
|
||||||
# https://github.com/NixOS/nixpkgs/issues/489947
|
# https://github.com/NixOS/nixpkgs/issues/489947
|
||||||
# Apply CachyOS kernel 6.19 patch to NVIDIA latest driver
|
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||||
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 ];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
# required by most wayland compositors!
|
# required by most wayland compositors!
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user