36 lines
673 B
Nix
36 lines
673 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
inherit (lib) mkDefault;
|
|
in
|
|
{
|
|
boot = {
|
|
blacklistedKernelModules = [ "nouveau" ];
|
|
extraModulePackages = [ config.hardware.nvidia.package ];
|
|
initrd.kernelModules = [ "nvidia" ];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
nvtopPackages.nvidia
|
|
];
|
|
|
|
hardware = {
|
|
enableRedistributableFirmware = true;
|
|
graphics.enable = true;
|
|
nvidia = {
|
|
modesetting.enable = true;
|
|
nvidiaSettings = true;
|
|
open = false;
|
|
package = mkDefault config.boot.kernelPackages.nvidiaPackages.latest;
|
|
};
|
|
};
|
|
|
|
nixpkgs.config.cudaSupport = true;
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
}
|