mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
feat: move grafana to its own config so i can disable it easier
This commit is contained in:
parent
5ca085b6da
commit
102e83b169
2 changed files with 34 additions and 26 deletions
22
modules/services/grafana.nix
Normal file
22
modules/services/grafana.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ config, ... }:
|
||||
{
|
||||
services = {
|
||||
grafana = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
domain = "monitoring.liv.town";
|
||||
http_addr = "127.0.0.1";
|
||||
http_port = 2342;
|
||||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts.${config.services.grafana.domain} = {
|
||||
useACMEHost = "liv.town";
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
}:
|
||||
}
|
||||
|
|
@ -1,23 +1,6 @@
|
|||
{ config, ... }: {
|
||||
{ config, ... }:
|
||||
{
|
||||
services = {
|
||||
grafana = {
|
||||
enable = true;
|
||||
settings.server = {
|
||||
domain = "monitoring.liv.town";
|
||||
http_addr = "127.0.0.1";
|
||||
http_port = 2342;
|
||||
};
|
||||
};
|
||||
|
||||
nginx.virtualHosts.${config.services.grafana.domain} = {
|
||||
useACMEHost = "liv.town";
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
prometheus = {
|
||||
enable = true;
|
||||
port = 9001;
|
||||
|
|
@ -28,13 +11,16 @@
|
|||
port = 9002;
|
||||
};
|
||||
};
|
||||
scrapeConfigs = [{
|
||||
job_name = "violet";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
|
||||
}];
|
||||
}];
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "${config.networking.hostname}";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue