nixos/services/bot_discord/ada.nix
2025-06-29 14:11:53 +02:00

39 lines
728 B
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.service.bot_discord.ada;
in
{
config = lib.mkIf cfg {
users = {
groups.dsc_ada = {
name = "dsc_ada";
};
users.dsc_ada = {
description = "Utilisateur pour le bot Ada";
group = "dsc_ada";
home = "/opt/Ada";
isSystemUser = true;
};
};
systemd.services.bot_ada = {
description = "Ada (chdoe asso) discord bot public";
after = [
"network.target"
];
wantedBy = [
"multi-user.target"
];
serviceConfig = {
Type = "simple";
User = "dsc_ada";
WorkingDirectory = "/opt/Ada";
ExecStart = "/opt/Ada/bot.py";
EnvironmentFile = "/opt/Ada/.env";
Restart = "on-failure";
RestartSec = 5;
};
};
};
}