1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/systems/makanek/menstruation.nix

60 lines
1.6 KiB
Nix
Raw Normal View History

2022-03-10 21:52:12 +01:00
{
pkgs,
lib,
...
}: let
2021-12-30 16:42:02 +01:00
backend = pkgs.callPackage <menstruation-backend> {};
2022-12-01 13:39:16 +01:00
old-pkgs = import (pkgs.fetchFromGitHub {
owner = "NixOs";
repo = "nixpkgs";
rev = "695b3515251873e0a7e2021add4bba643c56cde3";
hash = "sha256-T86oFvcUIRwHWBWUt7WjaP4BP/3lDGbv5AppQSI1FkI=";
}) {};
telegram = old-pkgs.poetry2nix.mkPoetryApplication {projectDir = <menstruation-telegram>;};
2021-10-18 21:14:52 +02:00
backendPort = 8000;
2022-03-10 21:52:12 +01:00
in {
2022-07-19 21:33:45 +02:00
services.redis.servers.menstruation = {
enable = true;
port = 6379;
};
2021-10-18 21:14:52 +02:00
2022-03-10 21:52:12 +01:00
environment.systemPackages = [pkgs.redis];
2022-01-07 17:23:28 +01:00
2022-05-22 11:47:59 +02:00
niveum.passport.services = [
{
title = "Tischlein, deck dich!";
description = "serves you with Berlin canteen menus via Telegram.";
link = "https://t.me/TischleinDeckDichBot";
}
];
2022-01-07 17:23:28 +01:00
systemd.services.menstruation-telegram = {
wants = [
"network-online.target"
"menstruation-backend.service"
2022-07-19 21:33:45 +02:00
"redis-menstruation.service"
2022-01-07 17:23:28 +01:00
];
2022-03-10 21:52:12 +01:00
wantedBy = ["multi-user.target"];
2022-01-07 17:23:28 +01:00
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";
2021-10-18 21:14:52 +02:00
};
2022-01-07 17:23:28 +01:00
};
2021-10-18 21:14:52 +02:00
2022-01-07 17:23:28 +01:00
systemd.services.menstruation-backend = {
2022-03-10 21:52:12 +01:00
wants = ["network-online.target"];
2022-01-07 17:23:28 +01:00
environment.ROCKET_PORT = toString backendPort;
serviceConfig = {
Restart = "always";
DynamicUser = true;
ExecStart = "${backend}/bin/menstruation_server";
2021-10-18 21:14:52 +02:00
};
};
}