test: setting up opencloud and microvms

This commit is contained in:
Nick 2025-12-04 23:24:00 -06:00
parent 0ed3bb9b64
commit b5929e0834
8 changed files with 79 additions and 35 deletions

View file

@ -16,7 +16,7 @@ in
ports = {
port0 = 80;
port1 = 443;
port2 = 8443;
port3 = 8445; # Opencloud
port2 = 8080;
port3 = 8443;
};
}

View file

@ -32,7 +32,7 @@ in
];
subdomain = subdomain;
ports = {
port0 = 8080;
port0 = 8084;
port1 = 8081;
};
interface = {

View file

@ -45,7 +45,7 @@ in
imports = builtins.attrValues {
inherit (modules)
acme
caddy
caddy0
comfyui
firefly-iii
forgejo
@ -71,7 +71,7 @@ in
imports = builtins.attrValues {
inherit (modules)
acme
caddy
caddy1
impermanence
microvm
opencloud0

View file

@ -0,0 +1,33 @@
{ flake, ... }:
let
inherit (flake.config.services) instances;
inherit (flake.config.machines.devices) eris;
opencloud = instances.opencloud0;
service = instances.caddy;
in
{
services.caddy = {
enable = true;
virtualHosts = {
"${opencloud.domains.url0}" = {
extraConfig = ''
reverse_proxy ${eris.ip.address0}:${builtins.toString service.ports.port1} {
transport http {
tls
tls_insecure_skip_verify
}
}
'';
};
};
};
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
service.ports.port1
];
};
};
}

View file

@ -0,0 +1,20 @@
{ flake, ... }:
let
inherit (flake.config.services) instances;
service = instances.caddy;
in
{
services.caddy = {
enable = true;
};
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
service.ports.port1
];
};
};
}

View file

@ -1,20 +1,11 @@
{ flake, ... }:
let
inherit (flake.config.services) instances;
service = instances.caddy;
importList =
let
content = builtins.readDir ./.;
dirContent = builtins.filter (n: content.${n} == "directory") (builtins.attrNames content);
in
map (name: ./. + "/${name}") dirContent;
in
{
services.caddy = {
enable = true;
};
networking = {
firewall = {
allowedTCPPorts = [
service.ports.port0
service.ports.port1
];
};
};
imports = importList;
}