26 lines
617 B
Nix
26 lines
617 B
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
|
cfg = config.service.bot_discord.tempvoc;
|
|
in
|
|
{
|
|
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 = "/opt/tempvoc";
|
|
ExecStart = "${pkgs.nodejs}/bin/npm start";
|
|
Environment = "PATH=${pkgs.coreutils}/bin:${pkgs.bash}/bin:${pkgs.nodejs}/bin";
|
|
Restart = "on-failure";
|
|
RestartSec = 5;
|
|
};
|
|
};
|
|
};
|
|
}
|