fix: local resolution

This commit is contained in:
arcnmx 2024-01-14 12:55:51 -08:00
parent 500134de8b
commit 5c93db721a
3 changed files with 6 additions and 2 deletions

View file

@ -16,7 +16,7 @@ in {
config.networking.access = {
hostnameForNetwork = {
local = mkIf config.services.avahi.enable "${hostName}.local";
local = mkIf config.services.avahi.enable "${hostName}.local.cutie.moe";
tail = mkIf config.services.tailscale.enable "${hostName}.tail.cutie.moe";
global = mkIf config.networking.enableIPv6 "${hostName}.cutie.moe";
};

View file

@ -8,6 +8,7 @@
inherit (lib.modules) mkIf mkMerge mkBefore mkDefault;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.lists) optional elem;
inherit (lib.strings) toLower;
in {
options.services.home-assistant = with lib.types; {
mutableUiConfig = mkEnableOption "UI-editable config files";
@ -51,7 +52,9 @@ in {
# MDNS
services.avahi = mkIf (cfg.enable && cfg.homekit.enable) {
enable = mkDefault true;
publish.enable = false;
publish.enable = let
homekitNames = map (homekit: toLower homekit.name) cfg.config.homekit or [ ];
in mkIf (elem config.networking.hostName homekitNames) false;
};
systemd.services.home-assistant = mkIf (cfg.enable && cfg.mutableUiConfig) {