diff options
author | Azat Bahawi <azat@bahawi.net> | 2023-04-01 04:39:59 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2023-04-01 04:39:59 +0300 |
commit | f4145939712b0046e5d57906d4b157b8a150614d (patch) | |
tree | 3c8d24db6410692e0fa59570ff698d446ae5a96e /modules/nixos/soju.nix | |
parent | 2023-03-23 (diff) |
2023-04-01
Diffstat (limited to '')
-rw-r--r-- | modules/nixos/soju.nix | 15 |
1 files changed, 15 insertions, 0 deletions
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" |