modules/nixos/monitoring: matrix-alertmanager-receiver -> matrix-hook
This commit is contained in:
parent
076e33ddcc
commit
e9a020cfd5
5 changed files with 57 additions and 52 deletions
modules/nixos/monitoring
51
modules/nixos/monitoring/matrix-hook.nix
Normal file
51
modules/nixos/monitoring/matrix-hook.nix
Normal file
|
@ -0,0 +1,51 @@
|
|||
{ config, pkgs, ... }:
|
||||
let
|
||||
matrixHook = pkgs.buildGoModule rec {
|
||||
pname = "matrix-hook";
|
||||
version = "2e2770e685ca57e111b9dd2dc178cc6984404a25";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "pinpox";
|
||||
repo = "matrix-hook";
|
||||
rev = version;
|
||||
hash = "sha256-G5pq9sIz94V2uTYBcuHJsqD2/pMtxhWkAO8B0FncLbE=";
|
||||
};
|
||||
vendorHash = "sha256-185Wz9IpJRBmunl+KGj/iy37YeszbT3UYzyk9V994oQ=";
|
||||
postInstall = ''
|
||||
install message.html.tmpl -Dt $out
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
sops.secrets.nix-community-matrix-bot-token = { };
|
||||
|
||||
users.users.matrix-hook = {
|
||||
isSystemUser = true;
|
||||
group = "matrix-hook";
|
||||
};
|
||||
users.groups.matrix-hook = { };
|
||||
|
||||
systemd.services.matrix-hook = {
|
||||
description = "Matrix Hook";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = {
|
||||
HTTP_ADDRESS = "localhost";
|
||||
HTTP_PORT = "9088";
|
||||
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";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${matrixHook}/bin/matrix-hook";
|
||||
EnvironmentFile = [
|
||||
config.sops.secrets.nix-community-matrix-bot-token.path
|
||||
];
|
||||
Restart = "always";
|
||||
RestartSec = "10";
|
||||
User = "matrix-hook";
|
||||
Group = "matrix-hook";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue