2024-04-20 09:42:06 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2022-12-21 14:18:03 -07:00
|
|
|
|
2025-01-20 22:35:40 -05:00
|
|
|
let
|
|
|
|
cfg = config.nmasur.presets.services.avahi;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2022-12-21 14:18:03 -07:00
|
|
|
|
2025-01-20 22:35:40 -05:00
|
|
|
options.nmasur.presets.services.avahi.enable = lib.mkEnableOption "Avahi DNS service discovery";
|
2022-12-21 14:18:03 -07:00
|
|
|
|
2025-01-20 22:35:40 -05:00
|
|
|
config = lib.mkIf cfg.enable {
|
2023-04-15 10:10:10 -04:00
|
|
|
|
|
|
|
# DNS service discovery
|
2023-04-19 16:50:19 -04:00
|
|
|
services.avahi = {
|
|
|
|
enable = true;
|
|
|
|
domainName = "local";
|
2023-07-18 03:52:37 +00:00
|
|
|
ipv6 = false; # Should work either way
|
|
|
|
# Resolve local hostnames using Avahi DNS
|
2024-01-01 19:48:52 -05:00
|
|
|
nssmdns4 = true;
|
2023-04-19 16:50:19 -04:00
|
|
|
publish = {
|
|
|
|
enable = true;
|
|
|
|
addresses = true;
|
|
|
|
domain = true;
|
|
|
|
workstation = true;
|
|
|
|
};
|
|
|
|
};
|
2023-07-21 01:07:09 +00:00
|
|
|
|
2022-12-21 14:18:03 -07:00
|
|
|
};
|
2022-04-28 22:25:05 -04:00
|
|
|
}
|