mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 08:45:02 +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, ... }:
|
||||
let dataDir = "/var/lib/killua"; in
|
||||
{ config, lib, pkgs, ... }:
|
||||
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;
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
killua = {
|
||||
image = "docker.noratrieb.dev/killua-bot:ac8203d2";
|
||||
volumes = [
|
||||
"${dataDir}:/data"
|
||||
];
|
||||
systemd.services.killua = {
|
||||
description = "killua, an awesome discord bot";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
environment = {
|
||||
KILLUA_JSON_PATH = "/data/trivia_questions.json";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.killua_env.path ];
|
||||
login = {
|
||||
registry = "docker.noratrieb.dev";
|
||||
username = "nils";
|
||||
passwordFile = config.age.secrets.docker_registry_password.path;
|
||||
BOT_TOKEN_PATH = config.age.secrets.widetom_bot_token.path;
|
||||
CONFIG_PATH = config.age.secrets.widetom_config_toml.path;
|
||||
};
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
ExecStart = "${lib.getExe' pkgs.jdk17 "java"} -jar ${jarfile}";
|
||||
EnvironmentFile = [ config.age.secrets.killua_env.path ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue