feat(discord/tut): added the discord tut

This commit is contained in:
Raphael 2025-06-29 14:11:53 +02:00
parent 3bea500dc0
commit 89120d940b
5 changed files with 55 additions and 3 deletions

View file

@ -32,7 +32,8 @@
}; };
bot_discord = { bot_discord = {
master = true; master = true;
bde = true; bde = false;
tut = true;
marty = true; marty = true;
ada = true; ada = true;
music = false; music = false;

View file

@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let let
cfg = config.service.bot_discord.bde; cfg = config.service.bot_discord.ada;
in in
{ {
config = lib.mkIf cfg { config = lib.mkIf cfg {

View file

@ -0,0 +1,39 @@
{ config, pkgs, lib, ... }:
let
cfg = config.service.bot_discord.tut;
in
{
config = lib.mkIf cfg {
users = {
groups.dsc_loc = {
name = "dsc_loc";
};
users.dsc_loc = {
description = "Utilisateur pour le bot tut";
group = "dsc_loc";
home = "/opt/alerte_poste-master";
isSystemUser = true;
};
};
systemd.services.bot_loc = {
description = "loc discord bot public";
after = [
"network.target"
];
wantedBy = [
"multi-user.target"
];
serviceConfig = {
Type = "simple";
User = "dsc_loc";
WorkingDirectory = "/opt/alerte_poste-master";
ExecStart = "/opt/alerte_poste-master/.venv/bin/python /opt/alerte_poste-master/src/main.py";
EnvironmentFile = "/opt/alerte_poste-master/.env";
Restart = "on-failure";
RestartSec = 5;
};
};
};
}

View file

@ -13,6 +13,9 @@ let
ada_bot = import ./bot_discord/ada.nix { ada_bot = import ./bot_discord/ada.nix {
inherit config pkgs lib; inherit config pkgs lib;
}; };
tut_bot = import ./bot_discord/bot_loc.nix {
inherit config pkgs lib;
};
bde_bot = import ./bot_discord/bde.nix { bde_bot = import ./bot_discord/bde.nix {
inherit config pkgs lib; inherit config pkgs lib;
}; };
@ -28,6 +31,7 @@ in
imports = [ imports = [
ada_bot ada_bot
bde_bot bde_bot
tut_bot
master_bot master_bot
music_bot music_bot
tempvoc_bot tempvoc_bot
@ -46,10 +50,15 @@ in
default = false; default = false;
description = "Enable ada bot"; description = "Enable ada bot";
}; };
tut = lib.mkOption {
type = lib.types.bool;
default = false;
description = "enable tut bot";
};
bde = lib.mkOption { bde = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;
default = false; default = false;
description = "Enable bde bot"; description = "enable bde bot";
}; };
marty = lib.mkOption { marty = lib.mkOption {
type = lib.types.bool; type = lib.types.bool;

View file

@ -93,6 +93,9 @@ in
targets = [ targets = [
"https://raphael.parodi.pro" "https://raphael.parodi.pro"
"https://nextcloud.enium.eu" "https://nextcloud.enium.eu"
"https://htop.enium.eu"
"https://monitor.enium.eu"
"https://relance-pas-stp.me:4242"
]; ];
}]; }];
relabel_configs = [ relabel_configs = [