1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/systems/makanek/menstruation.nix
Kierán Meinhardt d03c6bb0de feat: convert to flake
feat(zaatar): convert to flake

feat(tahina, tabula): convert to flake

feat(makanek): convert to flake

feat(manakish, zaatar): convert to flake

feat(ci): build flake systems

fix: ci build

feat: secrets via submodule

foo

foo

foo
2023-02-23 15:12:53 +01:00

62 lines
1.6 KiB
Nix

{
config,
pkgs,
lib,
inputs,
...
}: let
backendPort = 8000;
in {
services.redis.servers.menstruation = {
enable = true;
port = 6379;
};
environment.systemPackages = [pkgs.redis];
niveum.passport.services = [
{
title = "Tischlein, deck dich!";
description = "serves you with Berlin canteen menus via Telegram.";
link = "https://t.me/TischleinDeckDichBot";
}
];
systemd.services.menstruation-telegram = {
wants = [
"network-online.target"
"menstruation-backend.service"
"redis-menstruation.service"
];
wantedBy = ["multi-user.target"];
environment = {
MENSTRUATION_ENDPOINT = "http://localhost:${toString backendPort}";
MENSTRUATION_MODERATORS = "18980945";
};
script = ''
set -efu
export MENSTRUATION_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/menstruation-token")"
${inputs.menstruation-telegram.defaultPackage.x86_64-linux}/bin/menstruation-telegram
'';
serviceConfig = {
Restart = "always";
DynamicUser = true;
LoadCredential = [
"menstruation-token:${config.age.secrets.telegram-token-menstruation.path}"
];
};
};
age.secrets.telegram-token-menstruation.file = ../../secrets/telegram-token-menstruation.age;
systemd.services.menstruation-backend = {
wants = ["network-online.target"];
environment.ROCKET_PORT = toString backendPort;
serviceConfig = {
Restart = "always";
DynamicUser = true;
ExecStart = "${inputs.menstruation-backend.defaultPackage.x86_64-linux}/bin/menstruation_server";
};
};
}