diff --git a/hosts/odyssey/comfyui-docker.nix b/hosts/odyssey/comfyui-docker.nix new file mode 100644 index 0000000..9e9050d --- /dev/null +++ b/hosts/odyssey/comfyui-docker.nix @@ -0,0 +1,34 @@ +{ + hardware.graphics.enable32Bit = true; + hardware.nvidia-container-toolkit.enable = true; + + virtualisation.docker.enable = true; + + virtualisation.oci-containers = { + backend = "docker"; + containers = { + comfyui = { + image = "ghcr.io/clsferguson/comfyui-docker:latest"; + autoStart = true; + ports = [ "8188:8188" ]; + extraOptions = [ + "--device=nvidia.com/gpu=all" + "--ipc=host" + ]; + volumes = [ + "/home/jordan/ComfyUI/user:/app/ComfyUI/user" + "/home/jordan/ComfyUI/custom_nodes:/app/ComfyUI/custom_nodes" + "/home/jordan/ComfyUI/models:/app/ComfyUI/models:rw" + "/home/jordan/ComfyUI/input:/app/ComfyUI/input:rw" + "/home/jordan/ComfyUI/output:/app/ComfyUI/output:rw" + ]; + environment = { + TZ = "Europe/London"; + PUID = "1000"; + PGID = "1000"; + COMFY_AUTO_INSTALL = "1"; + }; + }; + }; + }; +} diff --git a/hosts/odyssey/default.nix b/hosts/odyssey/default.nix index 6c9e81a..77343e0 100644 --- a/hosts/odyssey/default.nix +++ b/hosts/odyssey/default.nix @@ -7,6 +7,7 @@ { imports = [ ./hardware-configuration.nix + ./comfyui-docker.nix ./gitea-runner.nix ./nix-serve.nix ../desktop.nix