From b47ca1475decf1a98f10231f0cbeebfb75e7f6ea Mon Sep 17 00:00:00 2001 From: yokai Date: Tue, 4 Aug 2026 16:58:39 -0500 Subject: common: share LAN discovery settings Move ping and Avahi/mDNS configuration into a shared LAN discovery module so kusanagi and enzo both publish their .local names, resolve each other on the LAN, and answer ping. Keep mDNS scoped to the shared Wi-Fi interface instead of using Avahi's global firewall helper. Assisted-by: OpenAI:gpt-5 --- common/lan-discovery.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 common/lan-discovery.nix (limited to 'common/lan-discovery.nix') diff --git a/common/lan-discovery.nix b/common/lan-discovery.nix new file mode 100644 index 0000000..f12971f --- /dev/null +++ b/common/lan-discovery.nix @@ -0,0 +1,22 @@ +# LAN reachability and mDNS discovery shared by all machines. +{ ... }: + +{ + # Allow IPv4 ICMP echo requests so hosts can be found with ping. + networking.firewall.allowPing = true; + + # Avahi/mDNS: publish .local and resolve other *.local LAN names. + # Keep the multicast DNS firewall opening scoped to the Wi-Fi LAN interface. + networking.firewall.interfaces.wlp8s0.allowedUDPPorts = [ 5353 ]; + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = false; + allowInterfaces = [ "wlp8s0" ]; + publish = { + enable = true; + addresses = true; + workstation = true; + }; + }; +} -- cgit v1.3