nixos-configuration/nix-os/nvidia.nix

37 lines
1.3 KiB
Nix

{ config, lib, pkgs, ...}:
{
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Workaround for nvidia driver ghost display
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = true;
open = false;
nvidiaSettings = true;
package = let
nvidiaDrivers = 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=";
};
# TODO: Remove after updating nixpkgs to 24.11
# https://github.com/NixOS/nixpkgs/commit/0384602eac8bc57add3227688ec242667df3ffe3
in nvidiaDrivers // {
settings = nvidiaDrivers.settings.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ [ pkgs.vulkan-headers ];
});
};
};
nixpkgs.config.nvidia.acceptLicense = true;
}