test: microVM test

This commit is contained in:
Nick 2025-11-04 03:30:52 -06:00
parent bd1d74997d
commit f15baf7ccb
21 changed files with 405 additions and 529 deletions

View file

@ -71,10 +71,23 @@ let
email = genOptions stringType "address";
sops = genOptions stringType "path";
paths = genOptions stringType "path";
varPaths = genOptions stringType "path";
mntPaths = genOptions stringType "path";
secretPaths = genOptions stringType "path";
ports = genOptions intType "port";
interface = {
id = stringType;
mac = stringType;
idUser = stringType;
macUser = stringType;
ip = stringType;
gate = stringType;
ssh = intType;
};
ssl = {
cert = stringType;
key = stringType;
path = stringType;
};
};
};
@ -259,15 +272,26 @@ in
};
instancesFunctions = {
domain0 = "cloudbert.fun";
domain1 = "uprootnutrition.com";
servicePath = "/mnt/media/NAS1";
sopsPath = "/var/lib/secrets";
sslPath = "/var/lib/acme";
varLib = "/var/lib";
dummy = "";
};
instancesFunctions =
let
vm = "vm-";
var = "/var/lib";
in
{
domain0 = "cloudbert.fun";
domain1 = "uprootnutrition.com";
idPrefix = vm;
userPrefix = "user${vm}";
emailNoReply = "noreply";
servicePath = "/mnt/media/NAS1";
mntPath = "/mnt/storage";
varLib = var;
varPath = var;
sslPath = "${var}/acme";
sopsPath = "${var}/secrets";
secretPath = "${var}/secrets";
dummy = "";
};
themesFunctions = {
brogrammer = "brogrammer";

View file

@ -3,6 +3,7 @@ let
inherit (moduleFunctions.instancesFunctions)
sslPath
sopsPath
secretPath
;
label = "Acme";
@ -14,6 +15,9 @@ in
paths = {
path0 = sslPath;
};
secretPaths = {
path0 = secretPath;
};
sops = {
path0 = "${sopsPath}/${name}";
};

View file

@ -17,7 +17,6 @@ in
port0 = 80;
port1 = 443;
port2 = 8443;
port3 = 8444; # Nextcloud
port4 = 8445; # Opencloud
port3 = 8445; # Opencloud
};
}

View file

@ -2,25 +2,28 @@
let
inherit (moduleFunctions.instancesFunctions)
domain1
servicePath
idPrefix
userPrefix
varPath
mntPath
secretPath
sslPath
sopsPath
emailNoReply
;
label = "Forgejo";
name = "forgejo";
label = "Forgejo";
subdomain = "source";
domain = "${subdomain}.${domain1}";
secrets = "${secretPath}/${name}";
ssl = "${sslPath}/${domain}";
in
{
label = label;
name = name;
label = label;
short = label;
email = {
address0 = "noreply@${domain1}";
};
sops = {
path0 = "${sopsPath}/${name}";
address0 = "${emailNoReply}@${domain1}";
};
domains = {
url0 = domain;
@ -31,14 +34,30 @@ in
"forge"
"git"
];
paths = {
path0 = "${servicePath}/${label}";
};
ports = {
port0 = 3033;
};
interface = {
id = "${idPrefix}-${name}";
mac = "02:00:00:00:00:50";
idUser = "${userPrefix}-${name}";
macUser = "02:00:00:00:00:02";
ip = "192.168.50.50";
gate = "192.168.50.1";
ssh = 2200;
};
ssl = {
cert = "${sslPath}/${subdomain}.${domain1}/fullchain.pem";
key = "${sslPath}/${subdomain}.${domain1}/key.pem";
path = ssl;
cert = "${ssl}/fullchain.pem";
key = "${ssl}/key.pem";
};
varPaths = {
path0 = "${varPath}/${name}";
};
mntPaths = {
path0 = "${mntPath}/${name}";
};
secretPaths = {
path0 = secrets;
};
}

View file

@ -1,44 +0,0 @@
{ moduleFunctions }:
let
inherit (moduleFunctions.instancesFunctions)
domain0
servicePath
sslPath
sopsPath
;
label = "Nextcloud";
name = "nextcloud";
domain = "${name}.${domain0}";
in
{
label = label;
name = name;
short = "Next";
email = {
address0 = "noreply@${name}.${domain0}";
};
sops = {
path0 = "${sopsPath}/${name}";
};
domains = {
url0 = domain;
};
subdomain = name;
tags = [
name
"next"
"cloud"
"calendar"
];
paths = {
path0 = "${servicePath}/${label}";
};
ports = {
port0 = 8354; # Nextcloud
};
ssl = {
cert = "${sslPath}/${name}.${domain0}/fullchain.pem";
key = "${sslPath}/${name}.${domain0}/key.pem";
};
}