infra/nix/modules/avahi.nix

22 lines
605 B
Nix
Raw Permalink Normal View History

2023-10-15 22:16:06 +02:00
{
config,
pkgs,
...
}: {
services = {
avahi.enable = true;
avahi.openFirewall = true;
# avahi.nssmdns = true;
avahi.nssmdns = false; # configure nssModules manually below.
avahi.publish.enable = true;
avahi.publish.userServices = true;
};
# settings from avahi-daemon.nix where mdns is replaced with mdns4
system.nssModules = pkgs.lib.optional (!config.services.avahi.nssmdns) pkgs.nssmdns;
system.nssDatabases.hosts = with pkgs.lib;
optionals (!config.services.avahi.nssmdns) (mkMerge [
(mkBefore ["mdns4 [NOTFOUND=return]"]) # before resolve
]);
}