From 2d618a28ad80f286fd6d7972fbcaeefdb776bb17 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 29 May 2023 16:20:36 +0200 Subject: [PATCH] fix: only generate mdns zone if necessary --- hosts/common/core/resolved.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hosts/common/core/resolved.nix b/hosts/common/core/resolved.nix index c2c9698..1410059 100644 --- a/hosts/common/core/resolved.nix +++ b/hosts/common/core/resolved.nix @@ -59,17 +59,18 @@ # name to the link name. ++ mapNetworks (x: config.systemd.network.networks.${x}.matchConfig.Name or null) ); - in { - zones = lib.mkForce { - mdns.interfaces = mdnsInterfaces; - }; + in + lib.mkIf (mdnsInterfaces != []) { + zones = lib.mkForce { + mdns.interfaces = mdnsInterfaces; + }; - rules = lib.mkForce { - mdns-to-local = { - from = ["mdns"]; - to = ["local"]; - allowedUDPPorts = [5353]; + rules = lib.mkForce { + mdns-to-local = { + from = ["mdns"]; + to = ["local"]; + allowedUDPPorts = [5353]; + }; }; }; - }; }