mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 21:19: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,31 +6,8 @@
|
|||
}:
|
||||
let
|
||||
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 {
|
||||
services.glance = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server.port = cfg.port;
|
||||
|
||||
pages = lib.singleton {
|
||||
name = "Services";
|
||||
columns = lib.singleton {
|
||||
size = "full";
|
||||
widgets =
|
||||
servicesWidgets =
|
||||
allHosts
|
||||
|> lib.attrValues
|
||||
|> 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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue