feat(discord): adding the bde bot

This commit is contained in:
Raphael 2025-05-12 23:28:08 +02:00
parent 6e2d489667
commit 9b5e8eed29
3 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,33 @@
{ config, pkgs, lib, ... }:
let
cfg = config.service.bot_discord.bde;
in
{
config = lib.mkIf cfg {
environment.systemPackages = with pkgs; [
nix
];
systemd.services.bot_bde = {
description = "BDE discord bot public";
after = [
"network.target"
];
wantedBy = [
"multi-user.target"
];
serviceConfig = {
Type = "simple";
User = "nobody";
WorkingDirectory = "/opt/Bot_Auth";
ExecStart = "/opt/Bot_Auth/.venv/bin/python /opt/Bot_Auth/bot.py";
EnvironmentFile = "/opt/Bot_Auth/.env";
Restart = "on-failure";
RestartSec = 5;
Environment = lib.mkForce ''
Environment=PYTHONUNBUFFERED=1
'';
};
};
};
}