switch to grafana
This commit is contained in:
parent
e16ccb1ac1
commit
202c7aed6c
5 changed files with 33 additions and 28 deletions
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue