nixos-configuration/nix-os/nvidia.nix

37 lines
1.3 KiB
Nix
Raw Normal View History

2023-12-12 00:48:10 +01:00
{ config, lib, pkgs, ...}:
{
hardware.graphics = {
2023-12-12 00:48:10 +01:00
enable = true;
enable32Bit = true;
2023-12-12 00:48:10 +01:00
};
# Workaround for nvidia driver ghost display
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
2023-12-12 00:48:10 +01:00
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "565.57.01";
sha256_64bit = "sha256-buvpTlheOF6IBPWnQVLfQUiHv4GcwhvZW3Ks0PsYLHo=";
sha256_aarch64 = "sha256-aDVc3sNTG4O3y+vKW87mw+i9AqXCY29GVqEIUlsvYfE=";
openSha256 = "sha256-/tM3n9huz1MTE6KKtTCBglBMBGGL/GOHi5ZSUag4zXA=";
settingsSha256 = "sha256-H7uEe34LdmUFcMcS6bz7sbpYhg9zPCb/5AmZZFTx1QA=";
persistencedSha256 = "sha256-hdszsACWNqkCh8G4VBNitDT85gk9gJe1BlQ8LdrYIkg=";
patches = [
(pkgs.fetchpatch {
# Kernel 6.12 compatibility
# https://forums.developer.nvidia.com/t/patch-for-565-57-01-linux-kernel-6-12/313260
url = "https://github.com/Binary-Eater/open-gpu-kernel-modules/commit/8ac26d3c66ea88b0f80504bdd1e907658b41609d.patch";
hash = "sha256-+SfIu3uYNQCf/KXhv4PWvruTVKQSh4bgU1moePhe57U=";
})
];
2024-06-05 16:20:06 +02:00
};
2023-12-12 00:48:10 +01:00
};
2024-06-05 16:20:06 +02:00
nixpkgs.config.nvidia.acceptLicense = true;
2023-12-12 00:48:10 +01:00
}