diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix index db966722f70e..156bb150c5f7 100644 --- a/pkgs/os-specific/linux/nvidia-x11/default.nix +++ b/pkgs/os-specific/linux/nvidia-x11/default.nix @@ -71,6 +71,22 @@ rec { sha256_64bit = "sha256-Xagqf4x254Hn1/C+e3mNtNNE8mvU+s+avPPHHHH+dkA="; settingsSha256 = "sha256-ryUSiI8PsY3knkJLg0k1EmyYW5OWkhuZma/hmXNuojw="; persistencedSha256 = "sha256-/2h90Gq9NQd9Q+9eLVE6vrxXmINXxlLcSNOHxKToOEE="; + + prePatch = "pushd kernel"; + postPatch = "popd"; + + patches = [ + # source: https://gist.github.com/joanbm/963906fc6772d8955faf1b9cc46c6b04 + (fetchpatch { + url = "https://gist.github.com/joanbm/963906fc6772d8955faf1b9cc46c6b04/raw/0f99aa10d47b524aa0e6e3845664deac3a1ad9d9/nvidia-470xx-fix-linux-6.2.patch"; + hash = "sha256-5n5/4ivK8od8EJNJf0PI9ZZ4U5RjOw+h4HakA+lmW1c="; + }) + # source: https://gist.github.com/joanbm/d10e9cbbbb8e245b6e7e27b2db338faf + (fetchpatch { + url = "https://gist.github.com/joanbm/d10e9cbbbb8e245b6e7e27b2db338faf/raw/f5d5238bdbaa16cd4008658a0f82b9dd84f1b38f/nvidia-470xx-fix-linux-6.3.patch"; + hash = "sha256-mR+vXDHgVhWC0JeLgGlbNVCH8XTs7XnhEJS6BV75tI8="; + }) + ]; }; # Last one supporting x86 diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index ea9dbcabd0e9..e56318deca96 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -13,6 +13,7 @@ , settings32Bit ? false , prePatch ? "" +, postPatch ? null , patches ? [] , broken ? false , brokenOpen ? broken @@ -68,7 +69,7 @@ let else throw "nvidia-x11 does not support platform ${stdenv.hostPlatform.system}"; patches = if libsOnly then null else patches; - inherit prePatch; + inherit prePatch postPatch; inherit version useGLVND useProfiles; inherit (stdenv.hostPlatform) system; inherit i686bundled;