feat(ada): adding a single user (trying to patch but python is not fun)

This commit is contained in:
Raphael 2025-05-19 00:31:42 +02:00
parent fe18a72369
commit ba8396e72b
2 changed files with 14 additions and 14 deletions

View file

@ -5,9 +5,18 @@ let
in
{
config = lib.mkIf cfg {
environment.systemPackages = with pkgs; [
nix
];
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 = [
@ -18,15 +27,12 @@ in
];
serviceConfig = {
Type = "simple";
User = "nobody";
User = "dsc_ada";
WorkingDirectory = "/opt/Ada";
ExecStart = "/opt/Ada/.venv/bin/python /opt/Ada/bot.py";
ExecStart = "/opt/Ada/bot.py";
EnvironmentFile = "/opt/Ada/.env";
Restart = "on-failure";
RestartSec = 5;
Environment = lib.mkForce ''
Environment=PYTHONUNBUFFERED=1
'';
};
};
};

View file

@ -5,9 +5,6 @@ let
in
{
config = lib.mkIf cfg {
environment.systemPackages = with pkgs; [
nix
];
systemd.services.bot_bde = {
description = "BDE discord bot public";
after = [
@ -24,9 +21,6 @@ in
EnvironmentFile = "/opt/Bot_Auth/.env";
Restart = "on-failure";
RestartSec = 5;
Environment = lib.mkForce ''
Environment=PYTHONUNBUFFERED=1
'';
};
};
};