diff --git a/modules/nixos/monitoring/matrix-hook.nix b/modules/nixos/monitoring/matrix-hook.nix index ce599cd..6934bf1 100644 --- a/modules/nixos/monitoring/matrix-hook.nix +++ b/modules/nixos/monitoring/matrix-hook.nix @@ -34,7 +34,7 @@ in MX_HOMESERVER = "https://matrix-client.matrix.org"; MX_ID = "@nix-community-matrix-bot:matrix.org"; MX_ROOMID = "!cBybDCkeRlSWfuaFvn:numtide.com"; - MX_MSG_TEMPLATE = "${matrixHook}/message.html.tmpl"; + MX_MSG_TEMPLATE = "${./message.html.tmpl}"; }; serviceConfig = { Type = "simple"; diff --git a/modules/nixos/monitoring/message.html.tmpl b/modules/nixos/monitoring/message.html.tmpl new file mode 100644 index 0000000..5af17b3 --- /dev/null +++ b/modules/nixos/monitoring/message.html.tmpl @@ -0,0 +1,11 @@ +<p> +{{ if eq .Status "firing" }} +🔥 <strong><font color="#ff0000">FIRING</font></strong> +{{ else if eq .Status "resolved"}} +✅ <strong><font color="#00ff00">RESOLVED</font></strong> +{{ else }} +<strong><font>{{.Status}}</font></strong> " +{{ end }} <code>[{{.Labels.instance}}]</code> >> <b>{{.Labels.alertname}}</b> +</br> +{{.Annotations.description}} +</p>