diff --git a/nixos/modules/services/networking/avahi-daemon.nix b/nixos/modules/services/networking/avahi-daemon.nix index ab54eafb6877..b1ed28980cfe 100644 --- a/nixos/modules/services/networking/avahi-daemon.nix +++ b/nixos/modules/services/networking/avahi-daemon.nix @@ -276,6 +276,8 @@ in Extra config to append to avahi-daemon.conf. ''; }; + + debug = lib.mkEnableOption "debug logging"; }; config = lib.mkIf cfg.enable { @@ -356,7 +358,7 @@ in NotifyAccess = "main"; BusName = "org.freedesktop.Avahi"; Type = "dbus"; - ExecStart = "${cfg.package}/sbin/avahi-daemon --syslog -f ${avahiDaemonConf}"; + ExecStart = "${cfg.package}/sbin/avahi-daemon --syslog -f ${avahiDaemonConf} ${lib.optionalString cfg.debug "--debug"}"; ConfigurationDirectory = "avahi/services"; # Hardening diff --git a/nixos/tests/avahi.nix b/nixos/tests/avahi.nix index 77cb1d5332cb..9568c4fffb55 100644 --- a/nixos/tests/avahi.nix +++ b/nixos/tests/avahi.nix @@ -24,6 +24,7 @@ publish.userServices = true; publish.workstation = true; extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service"; + debug = true; }; } // pkgs.lib.optionalAttrs networkd {