mirror of
https://github.com/michaelthomson0797/nixos-server.git
synced 2025-12-19 11:28:48 +00:00
initial commit
This commit is contained in:
33
modules/nvidia.nix
Normal file
33
modules/nvidia.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
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"
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user