diff --git a/modules/monitoring.nix b/modules/monitoring.nix index e7e2260..2fb7ab4 100644 --- a/modules/monitoring.nix +++ b/modules/monitoring.nix @@ -34,5 +34,28 @@ secret_key = config.mySecrets.grafanaSecret; }; }; + provision = { + enable = true; + datasources.settings.datasources = [ + { + name = "Prometheus"; + type = "prometheus"; + access = "proxy"; + url = "http://127.0.0.1:9090"; + isDefault = true; + } + ]; + dashboards.settings.providers = [ + { + name = "Node Exporter Full"; + options.path = "/etc/grafana-dashboards"; + } + ]; + }; + }; + + environment.etc."grafana-dashboards/node-exporter-full.json".source = pkgs.fetchurl { + url = "https://grafana.com/api/dashboards/1860/revisions/37/download"; + sha256 = "0qza4j8lywrj08bqbww52dgh2p2b9rkhq5p313g72i57lrlkacfl"; }; }