Compare commits
No commits in common. "290f541c5f555c0203535c7be0771b70e803da0f" and "524edd90edd20a8856e06df6a88e33edbd076936" have entirely different histories.
290f541c5f
...
524edd90ed
3 changed files with 5 additions and 57 deletions
|
@ -44,28 +44,7 @@ in {
|
|||
check_for_updates = false;
|
||||
};
|
||||
|
||||
users.allow_signup = false;
|
||||
};
|
||||
provision = {
|
||||
enable = true;
|
||||
datasources.settings = {
|
||||
datasources = [
|
||||
(mkIf config.modules.system.services.database.postgresql.enable {
|
||||
name = "Prometheus";
|
||||
type = "prometheus";
|
||||
access = "proxy";
|
||||
url = "http://127.0.0.1:4024";
|
||||
isDefault = true;
|
||||
})
|
||||
|
||||
(mkIf config.modules.system.services.prometheus.enable {
|
||||
name = "PostgreSQL";
|
||||
type = "postgres";
|
||||
access = "proxy";
|
||||
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
|
||||
})
|
||||
];
|
||||
};
|
||||
# users.allow_signup = false;
|
||||
};
|
||||
};
|
||||
services.nginx = {
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
cfg = config.modules.system.services.loki;
|
||||
port = 4026;
|
||||
dataDir = "/srv/data/loki";
|
||||
in {
|
||||
options.modules.system.services.loki.enable = mkEnableOption "Grafana, a graphing service";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.loki = {
|
||||
enable = true;
|
||||
package = pkgs.loki;
|
||||
|
||||
configuration = {
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -13,6 +13,10 @@ in {
|
|||
options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall.allowedTCPPorts = [config.services.grafana.settings.server.http_port];
|
||||
|
||||
modules.system.services.database.postgresql.enable = true;
|
||||
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
package = pkgs.prometheus;
|
||||
|
@ -30,10 +34,6 @@ in {
|
|||
port = 4024;
|
||||
user = "postgres";
|
||||
};
|
||||
nginx = {
|
||||
enable = true;
|
||||
port = 4025;
|
||||
};
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
|
@ -51,11 +51,6 @@ in {
|
|||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.postgres.port}"];}];
|
||||
}
|
||||
{
|
||||
job_name = "nginx";
|
||||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.nginx.port}"];}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue