diff options
Diffstat (limited to 'chaski/services')
-rw-r--r-- | chaski/services/conduit.nix | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chaski/services/conduit.nix b/chaski/services/conduit.nix index 022863c..30d6a0b 100644 --- a/chaski/services/conduit.nix +++ b/chaski/services/conduit.nix @@ -1,5 +1,14 @@ { config, lib, pkgs, ... }: +let + botConfig = pkgs.writeText "ntfy-matrix-bot.toml" '' + matrix_homeserver = "https://conduit.stuebinm.eu" + matrix_username = "testbot" + matrix_rooms = [ "#test:conduit.stuebinm.eu" ] + ntfy_server = "https://ping.stuebinm.eu" + ntfy_topics = [ "monit" ] + ''; +in { services.matrix-conduit = { enable = true; @@ -11,7 +20,22 @@ port = 6167; allow_registration = false; }; + }; + + sops.secrets."ntfy-matrix-bot/env" = {}; + systemd.services.ntfy-matrix-bot = { + enable = true; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${lib.getExe pkgs.ntfy-matrix-bot} -c ${botConfig}"; + Type = "simple"; + RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; + DynamicUser = true; + BindPaths = botConfig; + EnvironmentFile = "/run/secrets/ntfy-matrix-bot/env"; + }; + environment.RUST_LOG = "ntfy_matrix_bot=info"; }; services.nginx.virtualHosts."conduit.stuebinm.eu" = { |