This allows running derivations which depend on cuda runtime without breaking the sandbox. We only need to add `requiredSystemFeatures = [ "cuda" ];` to the derivation. Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
15 lines
601 B
Nix
15 lines
601 B
Nix
{ lib, config, ... }:
|
|
{
|
|
# Configure Nvidia driver to use with CUDA
|
|
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production;
|
|
hardware.nvidia.open = lib.mkDefault (builtins.abort "hardware.nvidia.open not set");
|
|
hardware.graphics.enable = true;
|
|
nixpkgs.config.nvidia.acceptLicense = true;
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
# enable support for derivations which require nvidia-gpu to be available
|
|
# > requiredSystemFeatures = [ "cuda" ];
|
|
programs.nix-required-mounts.enable = true;
|
|
programs.nix-required-mounts.presets.nvidia-gpu.enable = true;
|
|
}
|