glance: Group services by host

This commit is contained in:
SebastianStork 2026-03-09 22:25:57 +01:00
parent 2d9a779fb1
commit 8c549955c2
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q

View file

@ -28,30 +28,31 @@ in
pages = lib.singleton { pages = lib.singleton {
name = "Services"; name = "Services";
columns = [ columns = lib.singleton {
{ size = "full";
size = "full"; widgets =
widgets = [ allHosts
|> lib.attrValues
|> lib.map (host: {
hostName = host.config.networking.hostName;
domains =
host.config.custom.services.caddy.virtualHosts |> lib.attrValues |> lib.map (vHost: vHost.domain);
})
|> lib.map (
{ hostName, domains }:
{ {
type = "monitor"; type = "monitor";
cache = "1m"; cache = "1m";
title = "Services"; title = "Services - ${hostName}";
sites = sites =
allHosts domains
|> lib.attrValues
|> lib.map (
host:
host.config.custom.services.caddy.virtualHosts |> lib.attrValues |> lib.map (vHost: vHost.domain)
)
|> lib.concatLists
|> lib.map (domain: { |> lib.map (domain: {
title = domain; title = domain;
url = "https://${domain}"; url = "https://${domain}";
}); });
} }
]; );
} };
];
}; };
}; };
}; };