nixos/services/bot_discord/ada.nix
2025-05-18 17:33:12 +02:00

33 lines
671 B
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.service.bot_discord.bde;
in
{
config = lib.mkIf cfg {
environment.systemPackages = with pkgs; [
nix
];
systemd.services.bot_ada = {
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
'';
};
};
};
}