It has been working on upstream Samba for years too, and it is just a couple of lines in smb.conf [1]
If Samba is built with mDNS support, that’s all you need, but it typically isn’t, so you also need to advertise the share using avahi-daemon or systemd-resolved on their respective configurations.
[1]: https://www.samba.org/samba/docs/4.9/man-html/vfs_fruit.8.ht...