feat: adding the configuration for discord bots

This commit is contained in:
Raphael 2025-02-02 23:43:31 +01:00
parent 7d2608a6e8
commit 852eab5386
7 changed files with 130 additions and 46 deletions

View file

@ -1,18 +1,21 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
cfg = config.service.bot_discord.tempvoc;
in
{
environment.systemPackages = with pkgs; [
nodejs
];
systemd.services.ticket = {
tempvoc = {
config = lib.mkIf cfg {
environment.systemPackages = with pkgs; [
nodejs
];
systemd.services.tempvoc = {
description = "Enium discord bot for tempvoc";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "nobody";
WorkingDirectory = "/root/tempvoc";
WorkingDirectory = "/opt/tempvoc";
ExecStart = "${pkgs.nodejs}/bin/npm start";
Environment = "PATH=${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.nodejs}/bin";
Restart = "on-failure";