Skip to content

Commit

Permalink
Add grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
nadavspi committed Dec 9, 2023
1 parent 249e5bc commit 8b22d1f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/hosts/prague/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

../../modules/services/adguard.nix
../../modules/services/caddy.nix
../../modules/services/grafana.nix
../../modules/services/unbound.nix
./keepalived.nix
];
Expand Down
4 changes: 4 additions & 0 deletions nixos/modules/services/adguard.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ with lib; let
domain = "nixos-desktop.nadav.is";
answer = "192.168.1.203";
}
{
domain = "grafana.nadav.is";
answer = "192.168.1.202";
}
];
in {
options.nadavspi.adguard = {
Expand Down
20 changes: 20 additions & 0 deletions nixos/modules/services/grafana.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{...}: let
grafanaHost = "grafana.nadav.is";
grafanaPort = 2342;
in {
services.grafana = {
enable = true;
settings.server = {
enable_gzip = true;
http_addr = "0.0.0.0";
http_port = grafanaPort;
};
};

services.nginx.virtualHosts.${grafanaHost} = {
locations."/" = {
proxyPass = "http://127.0.0.1:${grafanaPort}";
proxyWebsockets = true;
};
};
}

0 comments on commit 8b22d1f

Please sign in to comment.