mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 13:32:15 -06:00
test: forgejo microVM
This commit is contained in:
parent
6011a900de
commit
402f513a8d
4 changed files with 4 additions and 68 deletions
|
|
@ -274,14 +274,11 @@ in
|
||||||
|
|
||||||
instancesFunctions =
|
instancesFunctions =
|
||||||
let
|
let
|
||||||
vm = "vm-";
|
|
||||||
var = "/var/lib";
|
var = "/var/lib";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
domain0 = "cloudbert.fun";
|
domain0 = "cloudbert.fun";
|
||||||
domain1 = "uprootnutrition.com";
|
domain1 = "uprootnutrition.com";
|
||||||
idPrefix = vm;
|
|
||||||
userPrefix = "user${vm}";
|
|
||||||
emailNoReply = "noreply";
|
emailNoReply = "noreply";
|
||||||
servicePath = "/mnt/media/NAS1";
|
servicePath = "/mnt/media/NAS1";
|
||||||
mntPath = "/mnt/storage";
|
mntPath = "/mnt/storage";
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
let
|
let
|
||||||
inherit (moduleFunctions.instancesFunctions)
|
inherit (moduleFunctions.instancesFunctions)
|
||||||
domain1
|
domain1
|
||||||
idPrefix
|
|
||||||
userPrefix
|
|
||||||
varPath
|
varPath
|
||||||
mntPath
|
mntPath
|
||||||
secretPath
|
secretPath
|
||||||
|
|
@ -38,9 +36,9 @@ in
|
||||||
port0 = 3033;
|
port0 = 3033;
|
||||||
};
|
};
|
||||||
interface = {
|
interface = {
|
||||||
id = "${idPrefix}${name}";
|
id = "vm-${name}";
|
||||||
mac = "02:00:00:00:00:50";
|
mac = "02:00:00:00:00:50";
|
||||||
idUser = "${userPrefix}${name}";
|
idUser = "vm-${name}";
|
||||||
macUser = "02:00:00:00:00:02";
|
macUser = "02:00:00:00:00:02";
|
||||||
ip = "192.168.50.50";
|
ip = "192.168.50.50";
|
||||||
gate = "192.168.50.2";
|
gate = "192.168.50.2";
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@ let
|
||||||
inherit (moduleFunctions.instancesFunctions)
|
inherit (moduleFunctions.instancesFunctions)
|
||||||
domain0
|
domain0
|
||||||
sslPath
|
sslPath
|
||||||
idPrefix
|
|
||||||
userPrefix
|
|
||||||
varPath
|
varPath
|
||||||
mntPath
|
mntPath
|
||||||
secretPath
|
secretPath
|
||||||
|
|
@ -37,9 +35,9 @@ in
|
||||||
port0 = 8085;
|
port0 = 8085;
|
||||||
};
|
};
|
||||||
interface = {
|
interface = {
|
||||||
id = "${idPrefix}-${name}";
|
id = "vm-${name}";
|
||||||
mac = "02:00:00:00:00:51";
|
mac = "02:00:00:00:00:51";
|
||||||
idUser = "${userPrefix}-${name}";
|
idUser = "vm-${name}";
|
||||||
macUser = "02:00:00:00:00:03";
|
macUser = "02:00:00:00:00:03";
|
||||||
ip = "192.168.50.51";
|
ip = "192.168.50.51";
|
||||||
gate = "192.168.50.1";
|
gate = "192.168.50.1";
|
||||||
|
|
|
||||||
|
|
@ -3,61 +3,4 @@
|
||||||
imports = [
|
imports = [
|
||||||
flake.inputs.microvm.nixosModules.host
|
flake.inputs.microvm.nixosModules.host
|
||||||
];
|
];
|
||||||
|
|
||||||
# Enable systemd-networkd for microvm networking only
|
|
||||||
# NetworkManager handles the main network interface
|
|
||||||
systemd.network = {
|
|
||||||
enable = true;
|
|
||||||
wait-online.enable = false; # Don't wait for networkd interfaces
|
|
||||||
|
|
||||||
# Create a bridge for all microvms
|
|
||||||
netdevs = {
|
|
||||||
"20-br-vms" = {
|
|
||||||
netdevConfig = {
|
|
||||||
Name = "br-vms";
|
|
||||||
Kind = "bridge";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networks = {
|
|
||||||
# Configure the bridge with an IP in your LAN
|
|
||||||
"20-br-vms" = {
|
|
||||||
matchConfig.Name = "br-vms";
|
|
||||||
address = [ "192.168.50.2/24" ];
|
|
||||||
networkConfig = {
|
|
||||||
ConfigureWithoutCarrier = true;
|
|
||||||
# VMs will use this as their gateway
|
|
||||||
};
|
|
||||||
linkConfig = {
|
|
||||||
RequiredForOnline = "no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Tap interface for forgejo VM (handles both vm-forgejo and vm--forgejo)
|
|
||||||
"30-vm-forgejo" = {
|
|
||||||
matchConfig.Name = "vm-*forgejo";
|
|
||||||
networkConfig = {
|
|
||||||
Bridge = "br-vms";
|
|
||||||
ConfigureWithoutCarrier = true;
|
|
||||||
};
|
|
||||||
linkConfig = {
|
|
||||||
RequiredForOnline = "no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Tap interface for vaultwarden VM (if you add it)
|
|
||||||
"30-vm-vaultwarden" = {
|
|
||||||
matchConfig.Name = "vm-*vaultwarden";
|
|
||||||
networkConfig = {
|
|
||||||
Bridge = "br-vms";
|
|
||||||
ConfigureWithoutCarrier = true;
|
|
||||||
};
|
|
||||||
linkConfig = {
|
|
||||||
RequiredForOnline = "no";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue