juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
327 stars 28 forks source link

feat(grafana): add providers configuration #211

Closed alexpearce closed 2 months ago

alexpearce commented 2 months ago

Addresses juspay/services-flake#210.

I've tested this by hand with configuration:

services.grafana."grafana" = {
  enable = true;
  providers = [
    {
      name = "Databases";
      type = "file";
      options = {
        path = ./dashboards;
        foldersFromFilesStructure = true;
      };
    }
  ];
};

I haven't looked into it, but it might be possible to extend the existing Grafana test to check that a folder of dashboards is loaded.

alexpearce commented 2 months ago

I'm not sure how best to run the tests locally. test/flake.nix refers services-flake as juspay/services-flake so it won't pick up changes in my local repo.

shivaraj-bh commented 2 months ago

I'm not sure how best to run the tests locally. test/flake.nix refers services-flake as juspay/services-flake so it won't pick up changes in my local repo.

Once in the devShell you can run just test grafana to run the test locally

alexpearce commented 2 months ago

Nice, thanks!

I had to modify the tests to use nixos-24.05 to work around the Grafana-on-macOS issue, but with my latest commit the tests pass.

shivaraj-bh commented 2 months ago

Thanks @alexpearce