glance: Add search bar

This commit is contained in:
SebastianStork 2026-03-09 23:43:38 +01:00
parent b4122e5f6b
commit 7ac4050d85
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q

View file

@ -6,31 +6,8 @@
}: }:
let let
cfg = config.custom.web-services.glance; cfg = config.custom.web-services.glance;
in
{
options.custom.web-services.glance = {
enable = lib.mkEnableOption "";
domain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "";
};
port = lib.mkOption {
type = lib.types.port;
default = 63958;
};
};
config = lib.mkIf cfg.enable { servicesWidgets =
services.glance = {
enable = true;
settings = {
server.port = cfg.port;
pages = lib.singleton {
name = "Services";
columns = lib.singleton {
size = "full";
widgets =
allHosts allHosts
|> lib.attrValues |> lib.attrValues
|> lib.map (host: { |> lib.map (host: {
@ -59,6 +36,43 @@ in
); );
} }
); );
in
{
options.custom.web-services.glance = {
enable = lib.mkEnableOption "";
domain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "";
};
port = lib.mkOption {
type = lib.types.port;
default = 63958;
};
};
config = lib.mkIf cfg.enable {
services.glance = {
enable = true;
settings = {
server.port = cfg.port;
pages = lib.singleton {
name = "Home";
center-vertically = true;
hide-desktop-navigation = true;
columns = lib.singleton {
size = "full";
widgets = [
{
type = "search";
search-engine = "google";
autofocus = true;
}
{
type = "split-column";
widgets = servicesWidgets;
}
];
}; };
}; };
}; };