mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-06 21:17:14 -06:00
63 lines
1.5 KiB
Nix
Executable file
63 lines
1.5 KiB
Nix
Executable file
{ flake, ... }:
|
|
{
|
|
imports = [
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
}
|