diff --git a/hosts/grafana/default.nix b/hosts/grafana/default.nix index cb84dd9a..3661cebb 100644 --- a/hosts/grafana/default.nix +++ b/hosts/grafana/default.nix @@ -41,8 +41,16 @@ in { datasources.settings.datasources = map (datasource: { inherit (datasource) name type access orgId url password user database isDefault jsonData; }) (with builtins; fromJSON (readFile ./datasources.json)); - # for id in `curl https://root:SECRET@grafana.hq.c3d2.de/api/search | jq -j 'map(.uid) | join(" ")'`; do curl https://root:SECRET@grafana.hq.c3d2.de/api/dashboards/uid/$id | jq .dashboard > hosts/grafana/dashboards/$id.json;done - dashboards.path = ./dashboards; + dashboards = [ { + settings = { + apiVersion = 1; + providers = [ { + name = "c3d2"; + } ]; + }; + # for id in `curl https://root:SECRET@grafana.hq.c3d2.de/api/search | jq -j 'map(.uid) | join(" ")'`; do curl https://root:SECRET@grafana.hq.c3d2.de/api/dashboards/uid/$id | jq .dashboard > hosts/grafana/dashboards/$id.json;done + options.path = ./dashboards; + } ]; }; settings = {