mirror of
https://github.com/gburd/nix-config.git
synced 2024-11-15 00:36:25 +00:00
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ pkgs, config, ... }:
|
|
let
|
|
vulkanDriverFiles = [
|
|
"${config.hardware.nvidia.package}/share/vulkan/icd.d/nvidia_icd.x86_64.json"
|
|
"${config.hardware.nvidia.package.lib32}/share/vulkan/icd.d/nvidia_icd.i686.json"
|
|
];
|
|
in
|
|
{
|
|
environment = {
|
|
systemPackages = with pkgs; [ vulkan-tools nvtop ];
|
|
|
|
variables = {
|
|
VK_DRIVER_FILES = builtins.concatStringsSep ":" vulkanDriverFiles;
|
|
};
|
|
};
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
hardware = {
|
|
nvidia = {
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
|
|
modesetting.enable = true;
|
|
|
|
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
|
powerManagement.enable = false;
|
|
|
|
# Only works on modern Nvidia GPUs (Turing or newer).
|
|
powerManagement.finegrained = false;
|
|
|
|
# Use the NVidia open source kernel module:
|
|
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
|
|
open = false;
|
|
|
|
nvidiaSettings = true;
|
|
};
|
|
|
|
opengl = {
|
|
enable = true;
|
|
inherit (config.hardware.nvidia) package;
|
|
driSupport = true;
|
|
driSupport32Bit = true;
|
|
};
|
|
|
|
pulseaudio.support32Bit = true;
|
|
};
|
|
|
|
virtualisation.docker.enableNvidia = true;
|
|
}
|