mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
systemd killua
This commit is contained in:
parent
0d9250c75c
commit
ac2678fcdd
1 changed files with 21 additions and 17 deletions
|
|
@ -1,23 +1,27 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let dataDir = "/var/lib/killua"; in
|
let
|
||||||
|
jarfile = pkgs.fetchurl {
|
||||||
|
url =
|
||||||
|
"https://github.com/Noratrieb/killua-bot/releases/download/2023-08-26/KilluaBot.jar";
|
||||||
|
hash = "sha256-LUABYq6cRhLTLyZVzkIjIFHERcb7YQTzyAGaJB49Mxk=";
|
||||||
|
};
|
||||||
|
dataDir = "/var/lib/killua";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
age.secrets.killua_env.file = ../../secrets/killua_env.age;
|
age.secrets.killua_env.file = ../../secrets/killua_env.age;
|
||||||
|
|
||||||
virtualisation.oci-containers.containers = {
|
systemd.services.killua = {
|
||||||
killua = {
|
description = "killua, an awesome discord bot";
|
||||||
image = "docker.noratrieb.dev/killua-bot:ac8203d2";
|
wantedBy = [ "multi-user.target" ];
|
||||||
volumes = [
|
after = [ "network.target" ];
|
||||||
"${dataDir}:/data"
|
environment = {
|
||||||
];
|
BOT_TOKEN_PATH = config.age.secrets.widetom_bot_token.path;
|
||||||
environment = {
|
CONFIG_PATH = config.age.secrets.widetom_config_toml.path;
|
||||||
KILLUA_JSON_PATH = "/data/trivia_questions.json";
|
};
|
||||||
};
|
serviceConfig = {
|
||||||
environmentFiles = [ config.age.secrets.killua_env.path ];
|
DynamicUser = true;
|
||||||
login = {
|
ExecStart = "${lib.getExe' pkgs.jdk17 "java"} -jar ${jarfile}";
|
||||||
registry = "docker.noratrieb.dev";
|
EnvironmentFile = [ config.age.secrets.killua_env.path ];
|
||||||
username = "nils";
|
|
||||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue