24-AUG-2024
0101
nix-instantiate --eval -E 'builtins.fromJSON (builtins.readFile ./telperion/emerald.city/configs/grafana/dashboards/system-view.json)' | nixfmt
and
nix-instantiate --eval -E 'let template = import ./telperion/emerald.city/configs/grafana/dashboards/system-view-template.nix; in builtins.toJSON (template "daklytos")'
are my handy snippets of the day, the former I saw on a discourse answer, for how to quickly convert
json -> nix. I have some grafana dashboards I want to templatize, and the first step is getting them
converted. This made short work. Now I took this simple system dashboard and made it into a
template, I can then rattle off a bunch of basic dashboards for each of my services, and then
specialize them and store the specialized versions in the configs directory of telperion to
override it. daktylos uses a library function from laurelin to invoke the dashboards that are
already stored over there, and I’ll build up some helper functions as it makes sense. Once I’ve got
the initial version built, when I specialize them I can import them back into the repo, and
eventually I’ll set up something automated to push them to their own git repo or something.