avahi: Never set host-name' to the empty string in avahi-daemon.conf'.

This commit is contained in:
Ludovic Courtès 2012-09-07 10:58:53 +02:00
parent 27880ed729
commit f7530dc5ee

View file

@ -11,7 +11,13 @@ let
avahiDaemonConf = with cfg; pkgs.writeText "avahi-daemon.conf" ''
[server]
host-name=${hostName}
${# Users can set `networking.hostName' to the empty string, when getting
# a host name from DHCP. In that case, let Avahi take whatever the
# current host name is; setting `host-name' to the empty string in
# `avahi-daemon.conf' would be invalid.
if hostName != ""
then "host-name=${hostName}"
else ""}
browse-domains=${concatStringsSep ", " browseDomains}
use-ipv4=${if ipv4 then "yes" else "no"}
use-ipv6=${if ipv6 then "yes" else "no"}