summaryrefslogtreecommitdiff
path: root/modules/nixos/soju.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-04-01 04:39:59 +0300
committerAzat Bahawi <azat@bahawi.net>2023-04-01 04:39:59 +0300
commitf4145939712b0046e5d57906d4b157b8a150614d (patch)
tree3c8d24db6410692e0fa59570ff698d446ae5a96e /modules/nixos/soju.nix
parentf6e36a699ae2d073e340e0a5844b8e111ed3de37 (diff)
2023-04-01
Diffstat (limited to 'modules/nixos/soju.nix')
-rw-r--r--modules/nixos/soju.nix15
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"