From 7a087f91bbd4edc489765406726c1a348cf758f4 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 19 Jul 2025 19:11:24 -0500 Subject: [PATCH] feat: added comfy ui --- modules/nixos/services/comfyui/default.nix | 2 + systems/ceres/config/comfyui.nix | 51 +++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/modules/nixos/services/comfyui/default.nix b/modules/nixos/services/comfyui/default.nix index 1679abd..90cb702 100644 --- a/modules/nixos/services/comfyui/default.nix +++ b/modules/nixos/services/comfyui/default.nix @@ -2,10 +2,12 @@ config, lib, pkgs, + flake, ... }: let + inherit (flake.config.people) user0; cfg = config.services.comfyui; in { diff --git a/systems/ceres/config/comfyui.nix b/systems/ceres/config/comfyui.nix index 7fdc26d..371bee3 100755 --- a/systems/ceres/config/comfyui.nix +++ b/systems/ceres/config/comfyui.nix @@ -1,9 +1,29 @@ -{ config, pkgs, ... }: { + config, + pkgs, + flake, + ... +}: +let + inherit (flake.config.machines.devices) + ceres + ; + inherit (flake.config.services.instances) + comfyui + web + ; + service = comfyui; + localhost = web.localhost.address1; +in +{ + nixpkgs.overlays = [ + flake.inputs.nix-comfyui.overlays.default + ]; + services.comfyui = { enable = true; openFirewall = true; - host = "0.0.0.0"; # Allow external connections + host = localhost; package = pkgs.comfyuiPackages.comfyui.override { extensions = with pkgs.comfyuiPackages.extensions; [ acly-inpaint @@ -17,4 +37,31 @@ ]; }; }; + # fileSystems."/var/lib/${service.name}" = { + # device = service.paths.path0; + # fsType = "none"; + # options = [ + # "bind" + # ]; + # depends = [ + # ceres.storage0.mount + # ]; + # }; + + # systemd.tmpfiles.rules = [ + # "Z ${service.paths.path0} 755 ${service.name} ${service.name} -" + # "Z ${service.sops.path0} 755 ${service.name} ${service.name} -" + # ]; + + users.users.${service.name}.extraGroups = [ + "users" + ]; + + networking = { + firewall = { + allowedTCPPorts = [ + service.ports.port0 + ]; + }; + }; }