mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
nvidia-container-toolkit: nvidia driver: don't enable, assert enabled (#350339)
This commit is contained in:
commit
c53153d5b8
@ -78,6 +78,11 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf config.hardware.nvidia-container-toolkit.enable {
|
||||
assertions = [
|
||||
{ assertion = config.hardware.nvidia.datacenter.enable || lib.elem "nvidia" config.services.xserver.videoDrivers;
|
||||
message = ''`nvidia-container-toolkit` requires nvidia datacenter or desktop drivers: set `hardware.nvidia.datacenter.enable` or add "nvidia" to `services.xserver.videoDrivers`'';
|
||||
}];
|
||||
|
||||
virtualisation.docker = {
|
||||
daemon.settings = lib.mkIf
|
||||
(lib.versionAtLeast config.virtualisation.docker.package.version "25") {
|
||||
@ -130,9 +135,6 @@
|
||||
]);
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = lib.mkIf
|
||||
(!config.hardware.nvidia.datacenter.enable) [ "nvidia" ];
|
||||
|
||||
systemd.services.nvidia-container-toolkit-cdi-generator = {
|
||||
description = "Container Device Interface (CDI) for Nvidia generator";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
Loading…
Reference in New Issue
Block a user