Advertisement
Guest User

Untitled

a guest
Mar 6th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. dashboardJsonFiles =
  2. let
  3. dir = "${../../../dashboards}";
  4. dirEntries = builtins.readDir dir;
  5. jsonFiles = lib.filterAttrs
  6. (path: type: type == "regular" && lib.hasSuffix ".json" path)
  7. dirEntries;
  8. rawAttrs = map
  9. (name: {
  10. name = "grafana/dashboards/${name}";
  11. value = {
  12. source = builtins.toFile name (builtins.readFile "${dir}/${name}");
  13. };
  14. })
  15. (builtins.attrNames jsonFiles);
  16. in
  17. builtins.listToAttrs rawAttrs;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement