feat(discord): adding the ada bot

This commit is contained in:
Raphael 2025-05-18 17:31:00 +02:00
parent 9b5e8eed29
commit 6f422f5b80
3 changed files with 44 additions and 1 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 = "Ada (chdoe asso) discord bot public";
after = [
"network.target"
];
wantedBy = [
"multi-user.target"
];
serviceConfig = {
Type = "simple";
User = "nobody";
WorkingDirectory = "/opt/Ada";
ExecStart = "/opt/Ada/.venv/bin/python /opt/Ada/bot.py";
EnvironmentFile = "/opt/Ada/.env";
Restart = "on-failure";
RestartSec = 5;
Environment = lib.mkForce''
Environment=PYTHONUNBUFFERED=1
'';
};
};
};
}