From f4145939712b0046e5d57906d4b157b8a150614d Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sat, 1 Apr 2023 04:39:59 +0300 Subject: 2023-04-01 --- modules/nixos/soju.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/nixos/soju.nix') diff --git a/modules/nixos/soju.nix b/modules/nixos/soju.nix index 14faf00..3cfe015 100644 --- a/modules/nixos/soju.nix +++ b/modules/nixos/soju.nix @@ -34,6 +34,16 @@ in { type = with types; str; default = config.networking.fqdn; }; + + prometheus = { + enable = mkEnableOption "Prometheus exporter." // {default = true;}; + + port = mkOption { + description = "Port."; + type = with types; port; + default = 9259; + }; + }; }; config = let @@ -68,6 +78,11 @@ in { # https://soju.im/doc/soju.1.html configFile = pkgs.writeText "soju.conf" '' listen ${cfg.protocol}://${cfg.address}:${toString cfg.port} + ${ + with cfg.prometheus; + optionalString enable + "listen http+prometheus://localhost:${toString port}" + } db postgres ${ concatStringsSep " " [ "host=/run/postgresql" -- cgit v1.2.3