nix-config/hosts/minime/networking/uvm.nix

46 lines
845 B
Nix
Raw Permalink Normal View History

2025-01-12 21:32:36 +01:00
{ ... }:
{
# TODO: make a module
2025-01-12 13:45:55 +01:00
systemd.network = {
netdevs."10-microvm" = {
2025-01-12 13:45:55 +01:00
netdevConfig = {
2025-01-12 21:32:36 +01:00
Kind = "bridge";
Name = "microvm";
2025-01-12 13:45:55 +01:00
};
};
networks."10-microvm" = {
matchConfig.Name = "microvm";
2025-01-12 13:45:55 +01:00
networkConfig = {
DHCPServer = false;
IPv6SendRA = true;
};
2025-01-12 21:32:36 +01:00
addresses = [
{
Address = "10.99.99.1/24";
}
{
Address = "fd12:3456:789a::1/64";
}
];
ipv6Prefixes = [
{
Prefix = "fd12:3456:789a::/64";
}
];
2025-01-12 13:45:55 +01:00
};
2025-01-12 21:32:36 +01:00
networks."11-microvm" = {
2025-01-12 21:32:36 +01:00
matchConfig.Name = "uvm-*";
networkConfig.Bridge = "microvm";
2025-01-12 21:32:36 +01:00
};
};
networking.nat = {
enable = true;
enableIPv6 = true;
externalInterface = "enp90s0";
internalInterfaces = [ "microvm" ];
2025-01-12 13:45:55 +01:00
};
}