diff --git a/hosts/home-assistant/default.nix b/hosts/home-assistant/default.nix index e572eb22..b8ba29da 100644 --- a/hosts/home-assistant/default.nix +++ b/hosts/home-assistant/default.nix @@ -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;