mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 20:09:07 +01:00
glance: Add search bar
This commit is contained in:
parent
b4122e5f6b
commit
7ac4050d85
1 changed files with 44 additions and 30 deletions
|
|
@ -6,6 +6,36 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.custom.web-services.glance;
|
cfg = config.custom.web-services.glance;
|
||||||
|
|
||||||
|
servicesWidgets =
|
||||||
|
allHosts
|
||||||
|
|> lib.attrValues
|
||||||
|
|> lib.map (host: {
|
||||||
|
hostName = host.config.networking.hostName;
|
||||||
|
services = host.config.custom.meta.services |> lib.attrValues;
|
||||||
|
})
|
||||||
|
|> lib.filter ({ services, ... }: services != [ ])
|
||||||
|
|> lib.map (
|
||||||
|
{ hostName, services }:
|
||||||
|
{
|
||||||
|
type = "monitor";
|
||||||
|
cache = "1m";
|
||||||
|
title = "Services - ${hostName}";
|
||||||
|
sites =
|
||||||
|
services
|
||||||
|
|> lib.map (
|
||||||
|
{
|
||||||
|
name,
|
||||||
|
url,
|
||||||
|
icon,
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
title = name;
|
||||||
|
inherit url icon;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.custom.web-services.glance = {
|
options.custom.web-services.glance = {
|
||||||
|
|
@ -27,38 +57,22 @@ in
|
||||||
server.port = cfg.port;
|
server.port = cfg.port;
|
||||||
|
|
||||||
pages = lib.singleton {
|
pages = lib.singleton {
|
||||||
name = "Services";
|
name = "Home";
|
||||||
|
center-vertically = true;
|
||||||
|
hide-desktop-navigation = true;
|
||||||
columns = lib.singleton {
|
columns = lib.singleton {
|
||||||
size = "full";
|
size = "full";
|
||||||
widgets =
|
widgets = [
|
||||||
allHosts
|
{
|
||||||
|> lib.attrValues
|
type = "search";
|
||||||
|> lib.map (host: {
|
search-engine = "google";
|
||||||
hostName = host.config.networking.hostName;
|
autofocus = true;
|
||||||
services = host.config.custom.meta.services |> lib.attrValues;
|
}
|
||||||
})
|
{
|
||||||
|> lib.filter ({ services, ... }: services != [ ])
|
type = "split-column";
|
||||||
|> lib.map (
|
widgets = servicesWidgets;
|
||||||
{ hostName, services }:
|
}
|
||||||
{
|
];
|
||||||
type = "monitor";
|
|
||||||
cache = "1m";
|
|
||||||
title = "Services - ${hostName}";
|
|
||||||
sites =
|
|
||||||
services
|
|
||||||
|> lib.map (
|
|
||||||
{
|
|
||||||
name,
|
|
||||||
url,
|
|
||||||
icon,
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
title = name;
|
|
||||||
inherit url icon;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue