dotfiles/modules/nixos/services/comfyui/default.nix

53 lines
976 B
Nix
Raw Normal View History

2025-07-18 14:57:37 -05:00
{
2025-07-18 16:56:51 -05:00
config,
pkgs,
2025-07-18 18:58:51 -05:00
flake,
2025-07-18 16:23:38 -05:00
...
}:
2025-07-18 16:25:10 -05:00
let
2025-07-18 20:53:49 -05:00
inherit (flake.config.machines.devices) ceres;
inherit (flake.config.services.instances) comfyui web;
2025-07-18 18:58:51 -05:00
inherit (flake.config.people) user0;
2025-07-18 20:53:49 -05:00
service = comfyui;
localhost = web.localhost.address1;
2025-07-18 16:25:10 -05:00
in
2025-07-18 16:23:38 -05:00
{
2025-07-18 20:53:49 -05:00
services.comfyui = {
enable = true;
package = pkgs.comfyui-nvidia;
host = localhost;
models = builtins.attrValues pkgs.nixified-ai.models;
customNodes = with comfyui.pkgs; [
comfyui-gguf
comfyui-impact-pack
];
};
fileSystems."/var/lib/${service.name}" = {
device = service.paths.path0;
fsType = "none";
options = [
"bind"
];
depends = [
ceres.storage0.mount
];
2025-07-18 16:56:51 -05:00
};
2025-07-18 20:53:49 -05:00
systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
];
2025-07-18 16:56:51 -05:00
2025-07-18 20:53:49 -05:00
users.users.${service.name}.extraGroups = [
"users"
];
2025-07-18 16:56:51 -05:00
2025-07-18 20:53:49 -05:00
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
];
2025-07-18 16:56:51 -05:00
};
};
2025-07-18 14:57:37 -05:00
}