Enhance systemd service for discord bot

This commit is contained in:
thiloho
2023-09-23 21:27:06 +02:00
parent a7bf80fc65
commit 4650b468e0
2 changed files with 11 additions and 7 deletions

12
flake.lock generated
View File

@@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1693750073, "lastModified": 1695474974,
"narHash": "sha256-TSivhiEcVXVv8B5qr3ulNWLs9lBqV7Pg8Vb/5YgIgWQ=", "narHash": "sha256-qdHgNqx/IrRIwOvPq2hS5YRgkGsOitvJg5ApGpsAVC8=",
"owner": "thiloho", "owner": "thiloho",
"repo": "aurora", "repo": "aurora",
"rev": "5ec13fc044e628c354f7d9aa7c5842f68666440f", "rev": "94225228778bc25fe8ee9a65831cb4b7845b482c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -27,11 +27,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1694376907, "lastModified": 1695497123,
"narHash": "sha256-z3FUE3Kb/WhYCHslyFBDyuQpnYt1gRz7g8s60ztWqiw=", "narHash": "sha256-i9pQ86ZFgLBVukuR76Nz5LyoVe2j4xOzjhv9B4B/3Ew=",
"owner": "thiloho", "owner": "thiloho",
"repo": "discord-bot", "repo": "discord-bot",
"rev": "8278bbf024d5a6c20c92437bdf2b46b14c2ea856", "rev": "f4f6e5c9180fff6cd41715cd6c2192f4228ea91d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -84,7 +84,11 @@
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
after = ["network-online.target"]; after = ["network-online.target"];
serviceConfig = { serviceConfig = {
ExecStartPre = "${pkgs.nodejs_20}/bin/node dbInit.js"; Type = "simple";
ExecStartPre = [
"${pkgs.nodejs_20}/bin/node dbInit.js"
"${pkgs.nodejs_20}/bin/node deploy-commands.js --token=%d/bot.token --clientId=1142441791459704912"
];
ExecStart = "${pkgs.nodejs_20}/bin/node index.js --token=%d/bot.token"; ExecStart = "${pkgs.nodejs_20}/bin/node index.js --token=%d/bot.token";
LoadCredential = "bot.token:/var/run/bot-token.txt"; LoadCredential = "bot.token:/var/run/bot-token.txt";
WorkingDirectory = inputs.denbot.packages.${pkgs.system}.default; WorkingDirectory = inputs.denbot.packages.${pkgs.system}.default;