switch to grafana
This commit is contained in:
parent
e16ccb1ac1
commit
202c7aed6c
5 changed files with 33 additions and 28 deletions
|
@ -2,7 +2,7 @@
|
|||
conf = {
|
||||
ssh.enable = true;
|
||||
nginx.enable = true;
|
||||
netdata.enable = true;
|
||||
grafana.enable = true;
|
||||
mail.enable = false; # broken
|
||||
website.enable = true;
|
||||
fedi.enable = true;
|
||||
|
|
|
@ -9,11 +9,11 @@ in {
|
|||
./fonts
|
||||
./games
|
||||
./git
|
||||
./grafana
|
||||
./home
|
||||
./layout
|
||||
./mail
|
||||
./matrix
|
||||
./netdata
|
||||
./networking
|
||||
./nginx
|
||||
./niri
|
||||
|
|
30
modules/grafana/default.nix
Normal file
30
modules/grafana/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{ lib, pkgs, config, ... }: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (config) conf;
|
||||
cfg = config.services.grafana.settings.server;
|
||||
in mkIf conf.grafana.enable {
|
||||
services.nginx = {
|
||||
virtualHosts = {
|
||||
"grafana.twoneis.site" = {
|
||||
useACMEHost = "twoneis.site";
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://${toString cfg.http_addr}:${toString cfg.http_port}";
|
||||
proxyWebsockets = true;
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.grafana = {
|
||||
enable = true;
|
||||
settings = {
|
||||
server = {
|
||||
http_addr = "127.0.0.1";
|
||||
http_port = 3000;
|
||||
domain = "grafana.twoneis.site";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{ lib, pkgs, config, ... }: let
|
||||
inherit (lib) mkIf;
|
||||
inherit (config) conf;
|
||||
in mkIf conf.netdata.enable {
|
||||
services.nginx = {
|
||||
virtualHosts = {
|
||||
"netdata.twoneis.site" = {
|
||||
useACMEHost = "twoneis.site";
|
||||
forceSSL = true;
|
||||
locations."/".proxyPass = "http://localhost:19999";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.netdata = {
|
||||
enable = true;
|
||||
package = pkgs.netdata.override { withCloudUI = true; };
|
||||
config = {
|
||||
global = {
|
||||
"memory mode" = "ram";
|
||||
"error log" = "syslog";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -18,7 +18,7 @@ in {
|
|||
# Generally server options
|
||||
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.";
|
||||
netdata.enable = mkEnableOption "Enable netdata metrics tool.";
|
||||
grafana.enable = mkEnableOption "Enable grafana dashboarding tool.";
|
||||
mail.enable = mkEnableOption "Enable mail server.";
|
||||
website.enable = mkEnableOption "Serve website through nginx.";
|
||||
fedi.enable = mkEnableOption "Host a fedi server on this machine.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue