mdns: don't enable it if we already have avahi (#417)

This commit is contained in:
Jörg Thalheim 2024-04-19 15:31:53 +02:00 committed by GitHub
parent 937ddb11d8
commit d8945920cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,10 @@
{ lib, ... }: {
# Allows to find machines on the local network by name, i.e. useful for printer discovery
systemd.network.networks."99-ethernet-default-dhcp".networkConfig.MulticastDNS = lib.mkDefault "yes";
systemd.network.networks."99-wireless-client-dhcp".networkConfig.MulticastDNS = lib.mkDefault "yes";
networking.firewall.allowedUDPPorts = [ 5353 ]; # Multicast DNS
{ config, lib, ... }:
{
# Avahi is an alternative implementation. If it's enabled, than we don't need the code below.
config = lib.mkIf (!config.services.avahi.enable) {
# Allows to find machines on the local network by name, i.e. useful for printer discovery
systemd.network.networks."99-ethernet-default-dhcp".networkConfig.MulticastDNS = lib.mkDefault "yes";
systemd.network.networks."99-wireless-client-dhcp".networkConfig.MulticastDNS = lib.mkDefault "yes";
networking.firewall.allowedUDPPorts = [ 5353 ]; # Multicast DNS
};
}