Compare commits

...

3 commits

Author SHA1 Message Date
936d8f9090 grafana/module.nix: fix datasources 2025-04-18 15:59:15 +02:00
49969059ec tower/configuration.nix: enable prometheus 2025-04-18 15:58:56 +02:00
61f9e30242 prometheus/module.nix: fix cfg 2025-04-18 15:58:41 +02:00
3 changed files with 6 additions and 5 deletions

View file

@ -36,6 +36,7 @@
services = {
forgejo.enable = true;
grafana.enable = true;
prometheus.enable = true;
};
programs = {
editors = {

View file

@ -50,19 +50,19 @@ in {
enable = true;
datasources.settings = {
datasources = [
(mkIf config.modules.system.services.database.postgresql.enable {
(mkIf config.modules.system.services.prometheus.enable {
name = "Prometheus";
type = "prometheus";
access = "proxy";
url = "http://127.0.0.1:4024";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
isDefault = true;
})
(mkIf config.modules.system.services.prometheus.enable {
(mkIf config.modules.system.services.database.postgresql.enable {
name = "PostgreSQL";
type = "postgres";
access = "proxy";
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
url = "http://127.0.0.1:${toString config.services.prometheus.exporters.postgres.port}";
})
];
};

View file

@ -7,7 +7,7 @@
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.services.grafana;
cfg = config.modules.system.services.prometheus;
port = 4022;
in {
options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service";