home-assistant: add a stub network interface in c3d2 for mdns

This commit is contained in:
Astro 2023-04-08 22:15:10 +02:00
parent 03f19c46c4
commit 283c410ca6
1 changed files with 24 additions and 0 deletions

View File

@ -1,13 +1,37 @@
{ config, pkgs, ... }:
let
c3d2MacAddress = "00:0b:ad:00:1d:ea";
in
{
c3d2.deployment.server = "server10";
microvm = {
mem = 1 * 1024;
vcpu = 2;
# add a network interface in c3d2 for mDNS
interfaces = [ {
type = "tap";
id = builtins.substring 0 15 "c3d2-${config.networking.hostName}";
mac = c3d2MacAddress;
} ];
};
networking.hostName = "home-assistant";
systemd.network = {
links."40-c3d2" = {
matchConfig.MACAddress = c3d2MacAddress;
# rename interface to net name
linkConfig.Name = "c3d2";
};
networks."40-c3d2" = {
matchConfig.MACAddress = c3d2MacAddress;
networkConfig = {
LinkLocalAddressing = "yes";
IPv6AcceptRA = "no";
};
};
};
services = {
avahi.enable = true;