feat(discord): adding the ada bot
This commit is contained in:
parent
9b5e8eed29
commit
6f422f5b80
3 changed files with 44 additions and 1 deletions
|
|
@ -23,6 +23,7 @@
|
|||
bot_discord = {
|
||||
master = true;
|
||||
bde = true;
|
||||
ada = true;
|
||||
music = true;
|
||||
tempvoc = true;
|
||||
ticket = true;
|
||||
|
|
|
|||
33
services/bot_discord/ada.nix
Normal file
33
services/bot_discord/ada.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -10,6 +10,9 @@ let
|
|||
tempvoc_bot = import ./bot_discord/tempvoc.nix {
|
||||
inherit config pkgs lib;
|
||||
};
|
||||
ada_bot = import ./bot_discord/ada.nix {
|
||||
inherit config pkgs lib;
|
||||
};
|
||||
bde_bot = import ./bot_discord/bde.nix {
|
||||
inherit config pkgs lib;
|
||||
};
|
||||
|
|
@ -20,11 +23,12 @@ let
|
|||
in
|
||||
{
|
||||
imports = [
|
||||
ada_bot
|
||||
bde_bot
|
||||
master_bot
|
||||
music_bot
|
||||
tempvoc_bot
|
||||
ticket_bot
|
||||
bde_bot
|
||||
];
|
||||
|
||||
options.service.bot_discord = {
|
||||
|
|
@ -33,6 +37,11 @@ in
|
|||
default = false;
|
||||
description = "Enable master bot";
|
||||
};
|
||||
ada = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable ada bot";
|
||||
};
|
||||
bde = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue