mirror of
https://github.com/michaelthomson0797/nixos-server.git
synced 2025-12-19 11:28:48 +00:00
38 lines
948 B
Nix
38 lines
948 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: {
|
|
hardware.nvidia = {
|
|
open = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
nvidiaSettings = true;
|
|
};
|
|
|
|
services.xserver = {
|
|
enable = false;
|
|
videoDrivers = ["nvidia"];
|
|
};
|
|
|
|
hardware.nvidia-container-toolkit.enable = true;
|
|
hardware.nvidia-container-toolkit.mount-nvidia-executables = true;
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
nvidia-container-toolkit
|
|
];
|
|
|
|
services.k3s.containerdConfigTemplate = ''
|
|
{{ template "base" . }}
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia]
|
|
privileged_without_host_devices = false
|
|
runtime_engine = ""
|
|
runtime_root = ""
|
|
runtime_type = "io.containerd.runc.v2"
|
|
|
|
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.nvidia.options]
|
|
BinaryName = "${lib.getOutput "tools" config.hardware.nvidia-container-toolkit.package}/bin/nvidia-container-runtime"
|
|
'';
|
|
}
|