mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat(makanek): run mensa bot
This commit is contained in:
41
configs/menstruation.nix
Normal file
41
configs/menstruation.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
backend = pkgs.callPackage <niveum/submodules/menstruation-backend> {};
|
||||||
|
telegram = pkgs.callPackage <niveum/submodules/menstruation-telegram> {};
|
||||||
|
backendPort = 8000;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
containers.menstruation.autoStart = true;
|
||||||
|
containers.menstruation.config = { config, pkgs, ... }: {
|
||||||
|
services.redis.enable = true;
|
||||||
|
|
||||||
|
systemd.services.menstruation-telegram = {
|
||||||
|
wants = [
|
||||||
|
"network-online.target"
|
||||||
|
"menstruation-backend.service"
|
||||||
|
"redis.service"
|
||||||
|
];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
environment = {
|
||||||
|
MENSTRUATION_TOKEN = lib.strings.fileContents <system-secrets/telegram/menstruation.token>;
|
||||||
|
MENSTRUATION_ENDPOINT = "http://localhost:${toString backendPort}";
|
||||||
|
MENSTRUATION_MODERATORS = "18980945";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
DynamicUser = true;
|
||||||
|
ExecStart = "${telegram}/bin/menstruation-telegram";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.menstruation-backend = {
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
environment.ROCKET_PORT = toString backendPort;
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
DynamicUser = true;
|
||||||
|
ExecStart = "${backend}/bin/menstruation_server";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Submodule submodules/menstruation-telegram updated: 3eab0f8e4c...d941ccb4c1
@@ -59,6 +59,7 @@ in
|
|||||||
<niveum/configs/radio>
|
<niveum/configs/radio>
|
||||||
<niveum/configs/gitea.nix>
|
<niveum/configs/gitea.nix>
|
||||||
<niveum/configs/names.nix>
|
<niveum/configs/names.nix>
|
||||||
|
<niveum/configs/menstruation.nix>
|
||||||
<niveum/configs/telegram-bots>
|
<niveum/configs/telegram-bots>
|
||||||
<niveum/configs/weechat.nix>
|
<niveum/configs/weechat.nix>
|
||||||
<niveum/configs/urlwatch.nix>
|
<niveum/configs/urlwatch.nix>
|
||||||
|
|||||||
Reference in New Issue
Block a user