{ pkgs, config, ... }: { #imports = [ modules/go-neb.nix ]; services.go-neb = { enable = true; baseUrl = "http://localhost"; config = { clients = [{ UserId = "@marabot:maralorn.de"; AccessToken = pkgs.privateValue "" "matrix/marabot-token"; HomeServerUrl = "https://matrix.maralorn.de"; Sync = true; AutoJoinRooms = true; DisplayName = "marabot"; }]; realms = [ ]; sessions = [ ]; services = [ { ID = "alertmanager_service"; Type = "alertmanager"; UserId = "@marabot:maralorn.de"; Config = { webhook_url = "http://localhost:4050/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2UK"; rooms = { "!negVsngnYOmXYCLKiO:maralorn.de" = { text_template = '' {{range .Alerts -}} [{{ .Status }}] {{index .Annotations "description"}} ({{index .Labels "alertname" }}){{ end -}}''; html_template = '' {{range .Alerts -}}{{ $severity := index .Labels "severity" }}{{ if eq .Status "firing" }}{{ if eq $severity "critical"}}[FIRING - CRITICAL]{{ else if eq $severity "warning"}}[FIRING - WARNING]{{ else }}[FIRING - {{ $severity }}]{{ end }}{{ else }}[RESOLVED]{{ end }} {{ index .Annotations "description"}} {{ $url := index .Labels "url" }}{{ if eq $url "" }}{{ else }}more infos {{ end }}({{ index .Labels "alertname"}}, dashboard, silence)
{{end -}} ''; msg_type = "m.text"; # Must be either `m.text` or `m.notice` }; }; }; } ]; }; }; }