netdata again

This commit is contained in:
twoneis 2025-02-23 15:46:58 +01:00
parent 7185fdc514
commit 6b8f0afde8
4 changed files with 12 additions and 13 deletions

View file

@ -2,7 +2,7 @@
conf = { conf = {
ssh.enable = true; ssh.enable = true;
nginx.enable = true; nginx.enable = true;
grafana.enable = true; netdata.enable = true;
mail.enable = false; # broken mail.enable = false; # broken
website.enable = true; website.enable = true;
fedi.enable = true; fedi.enable = true;

View file

@ -9,11 +9,11 @@ in {
./fonts ./fonts
./games ./games
./git ./git
./grafana
./home ./home
./layout ./layout
./mail ./mail
./matrix ./matrix
./netdata
./networking ./networking
./nginx ./nginx
./niri ./niri

View file

@ -1,15 +1,14 @@
{ lib, pkgs, config, ... }: let { lib, pkgs, config, ... }: let
inherit (lib) mkIf; inherit (lib) mkIf;
inherit (config) conf; inherit (config) conf;
cfg = config.services.grafana.settings.server;
in mkIf conf.grafana.enable { in mkIf conf.grafana.enable {
services.nginx = { services.nginx = {
virtualHosts = { virtualHosts = {
"grafana.twoneis.site" = { "netdata.twoneis.site" = {
useACMEHost = "twoneis.site"; useACMEHost = "twoneis.site";
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://${toString cfg.http_addr}:${toString cfg.http_port}"; proxyPass = "http://localhost:19999";
proxyWebsockets = true; proxyWebsockets = true;
recommendedProxySettings = true; recommendedProxySettings = true;
}; };
@ -17,14 +16,14 @@ in mkIf conf.grafana.enable {
}; };
}; };
services.grafana = { services.netdata = {
enable = true; enable = true;
settings = { package = pkgs.netdata.override { withCloudUi = true; };
server = { config.global = {
http_addr = "127.0.0.1"; "memory mode" = "ram";
http_port = 3001; "debug log" = "none";
domain = "grafana.twoneis.site"; "access log" = "none";
}; "error log" = "syslog";
}; };
}; };
} }

View file

@ -18,7 +18,7 @@ in {
# Generally server options # Generally server options
ssh.enable = mkEnableOption "Install my public key to allow accessing this machine via ssh."; ssh.enable = mkEnableOption "Install my public key to allow accessing this machine via ssh.";
nginx.enable = mkEnableOption "Enable nginx. All the following options expect this to be enabled."; nginx.enable = mkEnableOption "Enable nginx. All the following options expect this to be enabled.";
grafana.enable = mkEnableOption "Enable grafana dashboarding tool."; netdata.enable = mkEnableOption "Enable netdata monitoring tool.";
mail.enable = mkEnableOption "Enable mail server."; mail.enable = mkEnableOption "Enable mail server.";
website.enable = mkEnableOption "Serve website through nginx."; website.enable = mkEnableOption "Serve website through nginx.";
fedi.enable = mkEnableOption "Host a fedi server on this machine."; fedi.enable = mkEnableOption "Host a fedi server on this machine.";