feat: infinitely expansible microvms

This commit is contained in:
Nick 2025-12-09 03:46:57 -06:00
parent a92229390e
commit 4c767d369f
55 changed files with 1089 additions and 1015 deletions

View file

@ -6,8 +6,8 @@
let
inherit (flake.config.services) instances;
serviceCfg = instances.comfyui;
localhost = instances.web.localhost.address1;
host = serviceCfg.domains.url0;
interfaceCfg = serviceCfg.interfaces.interface0;
host = interfaceCfg.domain;
dns = instances.web.dns.provider0;
dnsPath = "dns/${dns}";
@ -29,16 +29,16 @@ in
autoStart = true;
ports = [
"${localhost}:${toString serviceCfg.ports.port0}:8188"
"0.0.0.0:${toString serviceCfg.ports.port0}:8188"
];
volumes = [
"${serviceCfg.varPaths.path0}:/root"
"${serviceCfg.varPaths.path0}/models:/root/models"
"${serviceCfg.varPaths.path0}/custom_nodes:/root/custom_nodes"
"${serviceCfg.varPaths.path0}/output:/root/output"
"${serviceCfg.varPaths.path0}/input:/root/input"
"${serviceCfg.varPaths.path0}/user:/root/user"
"${interfaceCfg.paths.varPaths.path0}:/root"
"${interfaceCfg.paths.varPaths.path0}/models:/root/models"
"${interfaceCfg.paths.varPaths.path0}/custom_nodes:/root/custom_nodes"
"${interfaceCfg.paths.varPaths.path0}/output:/root/output"
"${interfaceCfg.paths.varPaths.path0}/input:/root/input"
"${interfaceCfg.paths.varPaths.path0}/user:/root/user"
];
environment = {
@ -77,7 +77,7 @@ in
}
# Main reverse proxy with WebSocket support
reverse_proxy ${localhost}:${toString serviceCfg.ports.port0} {
reverse_proxy 0.0.0.0:${toString serviceCfg.ports.port0} {
header_up Host {host}
header_up X-Real-IP {remote}
header_up X-Forwarded-For {remote}
@ -94,7 +94,7 @@ in
}
}
tls ${serviceCfg.ssl.cert} ${serviceCfg.ssl.key}
tls ${interfaceCfg.ssl.cert} ${interfaceCfg.ssl.key}
# Security headers
header {
@ -117,8 +117,8 @@ in
};
systemd.tmpfiles.rules = [
"d ${serviceCfg.varPaths.path0} 755 root root -"
"d ${serviceCfg.secretPaths.path0}/caddy 755 caddy caddy -"
"d ${interfaceCfg.paths.varPaths.path0} 755 root root -"
"d ${interfaceCfg.paths.secretPaths.path0}/caddy 755 caddy caddy -"
"d /var/log/caddy 755 caddy caddy -"
];