split genepi monitoring in two modules
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
./freshrss.nix
|
./freshrss.nix
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./immich.nix
|
./immich.nix
|
||||||
./monitoring.nix
|
./monitoring
|
||||||
./network.nix
|
./network.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
./persistence.nix
|
./persistence.nix
|
||||||
|
|||||||
6
hosts/genepi/monitoring/default.nix
Normal file
6
hosts/genepi/monitoring/default.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./grafana.nix
|
||||||
|
./prometheus.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
40
hosts/genepi/monitoring/grafana.nix
Normal file
40
hosts/genepi/monitoring/grafana.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
domain = "home.rpqt.fr";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
http_port = 3000;
|
||||||
|
domain = "grafana.${domain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
provision = {
|
||||||
|
enable = true;
|
||||||
|
datasources = {
|
||||||
|
settings = {
|
||||||
|
datasources = [
|
||||||
|
{
|
||||||
|
name = "Prometheus";
|
||||||
|
type = "prometheus";
|
||||||
|
access = "proxy";
|
||||||
|
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
|
||||||
|
isDefault = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
||||||
|
forceSSL = true;
|
||||||
|
useACMEHost = "${domain}";
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
lib,
|
||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
domain = "home.rpqt.fr";
|
|
||||||
|
|
||||||
allHosts = self.nixosConfigurations;
|
allHosts = self.nixosConfigurations;
|
||||||
|
|
||||||
hostInTailnetFilter = k: v: v.config.services.tailscale.enable;
|
hostInTailnetFilter = k: v: v.config.services.tailscale.enable;
|
||||||
@@ -47,41 +44,6 @@ let
|
|||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.grafana = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
server = {
|
|
||||||
http_port = 3000;
|
|
||||||
domain = "grafana.${domain}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
provision = {
|
|
||||||
enable = true;
|
|
||||||
datasources = {
|
|
||||||
settings = {
|
|
||||||
datasources = [
|
|
||||||
{
|
|
||||||
name = "Prometheus";
|
|
||||||
type = "prometheus";
|
|
||||||
access = "proxy";
|
|
||||||
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
|
|
||||||
isDefault = true;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
|
||||||
forceSSL = true;
|
|
||||||
useACMEHost = "${domain}";
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.http_port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 9001;
|
port = 9001;
|
||||||
Reference in New Issue
Block a user