hw accell and device mapper container for dev/dri usage in swarm

This commit is contained in:
2025-04-21 15:18:14 +02:00
parent bdeb445598
commit 969b77a3a8
5 changed files with 72 additions and 4 deletions

32
docker-device-mapper.nix Normal file
View File

@@ -0,0 +1,32 @@
{ config, pkgs, ... }:
{
virtualisation.docker.enable = true;
virtualisation.oci-containers = {
# Specify Docker as the backend engine
backend = "docker";
# Define your containers
containers = {
device-manager = {
image = "ndouba/device-mapping-manager";
# Equivalent to --restart always
autoStart = true;
privileged = true;
volumes = [
"/sys:/host/sys"
"/var/run/docker.sock:/var/run/docker.sock"
];
# Use extraOptions for flags not directly mapped to NixOS options
extraOptions = [
"--pid=host" # --pid=host
"--cgroupns=host" # --cgroupns=host
"--userns=host" # --userns=host
];
};
};
};
}