flake: sitch to npins
Signed-off-by: Bloxx12 <charlie@charlieroot.dev> Change-Id: I6a6a6964f4aa3349951fe7574622564452ad1af1
This commit is contained in:
parent
45179ade64
commit
2e7d11c2ed
24 changed files with 707 additions and 731 deletions
|
@ -1,62 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
|
||||
cfg = config.modules.system.services.prometheus;
|
||||
port = 4022;
|
||||
in {
|
||||
options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service";
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
package = pkgs.prometheus;
|
||||
inherit port;
|
||||
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
port = 4023;
|
||||
enabledCollectors = ["systemd" "processes"];
|
||||
};
|
||||
|
||||
postgres = {
|
||||
enable = true;
|
||||
port = 4024;
|
||||
user = "postgres";
|
||||
};
|
||||
nginx = {
|
||||
enable = true;
|
||||
port = 4025;
|
||||
};
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "prometheus";
|
||||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["localhost:${toString port}"];}];
|
||||
}
|
||||
{
|
||||
job_name = "node";
|
||||
scrape_interval = "30s";
|
||||
static_configs = [{targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];}];
|
||||
}
|
||||
{
|
||||
job_name = "postgres";
|
||||
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