1
0
Fork 0
nixos-config/nixos/roles/email2matrix.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2022-03-08 01:42:46 +00:00
{
pkgs,
config,
...
}: let
default_mailbox = {
MailboxName = "<missing>";
MatrixRoomId = "<missing>";
MatrixHomeserverUrl = "https://matrix.maralorn.de";
MatrixUserId = "@marabot:matrix.maralorn.de";
2020-10-01 05:10:28 +00:00
MatrixAccessToken = pkgs.privateValue "" "matrix/marabot-token";
IgnoreSubject = false;
IgnoreBody = false;
2019-08-13 21:49:38 +00:00
SkipMarkdown = false;
};
email2matrix-config = pkgs.writeText "email2matrix-config.json"
2022-03-08 01:42:46 +00:00
(builtins.toJSON {
Smtp = {
ListenInterface = "[::1]:2525";
Hostname = "email2matrix.maralorn.de";
Workers = 10;
};
Matrix = {
Mappings = [
(default_mailbox
// {
MailboxName = "notify";
MatrixRoomId = "!kTKVQjRwxjaoMQmcve:maralorn.de";
})
(default_mailbox
// {
MailboxName = "subjects";
MatrixRoomId = "!kTKVQjRwxjaoMQmcve:maralorn.de";
IgnoreBody = true;
})
(default_mailbox
// {
MailboxName = "weather";
MatrixRoomId = "!ELeFcSrHXgMqOmwnxg:maralorn.de";
})
];
};
Misc = {Debug = true;};
});
in {
systemd.services.email2matrix = {
2022-03-08 01:42:46 +00:00
script = "${pkgs.email2matrix}/bin/devture-email2matrix --config ${email2matrix-config}";
wantedBy = ["multi-user.target"];
};
}