Configure glances

This commit is contained in:
Oliver Davies 2025-04-30 13:42:51 +01:00
parent d809ab9fb6
commit c350b55948
5 changed files with 93 additions and 12 deletions

View file

@ -36,9 +36,18 @@ in
openFirewall = true;
customCSS = ''
#information-widgets {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
div#footer {
display: none;
}
.services-group {
margin-bottom: 3rem;
}
'';
services = (import ./services.nix { inherit config lib; });
@ -46,12 +55,13 @@ in
settings = {
headerStyle = "clean";
hideVersion = "true";
layout = (import ./layout.nix);
statusStyle = "dot";
};
widgets = import ./widgets.nix;
};
glances.enable = true;
nginx.virtualHosts.${cfg.url} = {
forceSSL = true;
useACMEHost = homelab.baseDomain;

View file

@ -0,0 +1,57 @@
{ config }:
{
Glances =
let
port = toString config.services.glances.port;
in
[
{
Info = {
widget = {
type = "glances";
url = "http://localhost:${port}";
metric = "info";
chart = false;
version = 4;
};
};
}
{
"CPU Temp" = {
widget = {
type = "glances";
url = "http://localhost:${port}";
metric = "sensor:Package id 0";
chart = false;
version = 4;
};
};
}
{
Processes = {
widget = {
type = "glances";
url = "http://localhost:${port}";
metric = "process";
chart = false;
version = 4;
};
};
}
{
Network = {
widget = {
type = "glances";
url = "http://localhost:${port}";
metric = "network:enp0s13f0u1";
chart = false;
version = 4;
};
};
}
];
}

View file

@ -0,0 +1,23 @@
[
{
Glances = {
columns = 4;
header = false;
style = "row";
};
}
{
Media = {
header = true;
style = "column";
};
}
{
Services = {
header = true;
style = "column";
};
}
]

View file

@ -29,4 +29,4 @@ let
});
});
in
services
services ++ [ (import ./glances.nix { inherit config; }) ]

View file

@ -1,9 +0,0 @@
[
{
resources = {
cpu = true;
disk = "/";
memory = true;
};
}
]