From c2d96e936eaac2e9b82cfd3329f6d8e242212ca5 Mon Sep 17 00:00:00 2001 From: "Giulio De Pasquale (aider)" Date: Thu, 5 Jun 2025 12:56:55 +0100 Subject: [PATCH] fix: Correctly generate extraHosts for vhosts --- modules/core/vhost.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/core/vhost.nix b/modules/core/vhost.nix index 1de5305..ab59695 100644 --- a/modules/core/vhost.nix +++ b/modules/core/vhost.nix @@ -121,10 +121,11 @@ in }) cfg.hosts; - networking.extraHosts = concatMapStringsSep "\n" - (domain: - mkIf cfg.hosts.${domain}.resolveLocally "127.0.0.1 ${domain}" + networking.extraHosts = lib.flatten (lib.mapAttrsToList + (domain: hostConf: + lib.optionals hostConf.resolveLocally "127.0.0.1 ${domain}" ) - (lib.attrNames cfg.hosts); + cfg.hosts + ); }; }