define grafana settings explicitly

This commit is contained in:
Noah Masur 2023-07-04 17:05:56 -06:00
parent 066ea8e440
commit 2c4f215b6e
2 changed files with 6 additions and 2 deletions

View File

@ -8,8 +8,11 @@
config = lib.mkIf config.services.grafana.enable {
# Required to fix error in latest nixpkgs
services.grafana.settings = { };
services.grafana.settings = {
http_addr = "127.0.0.1";
http_port = 3000;
domain = config.metricsServer;
};
caddy.routes = [{
match = [{ host = [ config.metricsServer ]; }];

View File

@ -19,6 +19,7 @@
}];
webExternalUrl = lib.mkIf config.services.grafana.enable
"https://${config.prometheusServer}";
# Web config file: https://prometheus.io/docs/prometheus/latest/configuration/https/
webConfigFile =
lib.mkIf config.services.grafana.enable (pkgs.formats.yaml { }).generate
"webconfig.yml" {