Allow for smtp == imap servers

This commit is contained in:
niten 2024-01-30 14:21:27 -08:00
parent 7a9e234259
commit cefa63892d
1 changed files with 7 additions and 8 deletions

View File

@ -201,14 +201,13 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
services = { services = {
nginx = { nginx = {
virtualHosts = { virtualHosts =
"${cfg.smtp.hostname}".locations."/metrics" = { let mailHostnames = unique [ cfg.smtp.hostname cfg.imap.hostname ];
in genAttrs mailHostnames (hostname: {
"${hostname}".locations."/metrics" = {
proxyPass = "http://localhost:${toString metricsPort}/metrics"; proxyPass = "http://localhost:${toString metricsPort}/metrics";
}; };
"${cfg.imap.hostname}".locations."/metrics" = { });
proxyPass = "http://localhost:${toString metricsPort}/metrics";
};
};
}; };
}; };