fix: Correctly generate extraHosts for vhosts

This commit is contained in:
Giulio De Pasquale (aider) 2025-06-05 12:56:55 +01:00
parent 7217af2233
commit c2d96e936e

View File

@ -121,10 +121,11 @@ in
}) })
cfg.hosts; cfg.hosts;
networking.extraHosts = concatMapStringsSep "\n" networking.extraHosts = lib.flatten (lib.mapAttrsToList
(domain: (domain: hostConf:
mkIf cfg.hosts.${domain}.resolveLocally "127.0.0.1 ${domain}" lib.optionals hostConf.resolveLocally "127.0.0.1 ${domain}"
) )
(lib.attrNames cfg.hosts); cfg.hosts
);
}; };
} }