2024-11-09 15:21:12 +01:00
|
|
|
{ config, ... }: let
|
|
|
|
stateDir = "/data/monitoring/prometheus";
|
|
|
|
in {
|
2023-01-21 19:55:29 +01:00
|
|
|
imports = [
|
2024-09-14 20:21:12 +02:00
|
|
|
./gitea.nix
|
2023-01-21 19:55:29 +01:00
|
|
|
./matrix-synapse.nix
|
2023-07-10 00:00:13 +02:00
|
|
|
# TODO: enable once https://github.com/NixOS/nixpkgs/pull/242365 gets merged
|
|
|
|
# ./mysqld.nix
|
2023-01-21 22:31:12 +01:00
|
|
|
./postgres.nix
|
2024-09-05 14:14:28 +02:00
|
|
|
./machines.nix
|
2023-01-21 19:55:29 +01:00
|
|
|
];
|
2023-01-23 13:12:46 +01:00
|
|
|
|
2023-01-21 19:55:29 +01:00
|
|
|
services.prometheus = {
|
|
|
|
enable = true;
|
2024-11-09 15:21:12 +01:00
|
|
|
|
2023-01-21 19:55:29 +01:00
|
|
|
listenAddress = "127.0.0.1";
|
|
|
|
port = 9001;
|
|
|
|
|
|
|
|
ruleFiles = [ rules/synapse-v2.rules ];
|
|
|
|
};
|
2024-11-09 15:21:12 +01:00
|
|
|
|
|
|
|
fileSystems."/var/lib/prometheus2" = {
|
|
|
|
device = stateDir;
|
|
|
|
options = [ "bind" ];
|
|
|
|
};
|
2023-01-21 19:55:29 +01:00
|
|
|
}
|