nixconf/docker-device-mapper.nix
2025-04-21 16:48:42 +02:00

33 lines
766 B
Nix

{ 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
];
};
};
};
}