configure trucksimulatorbot

This commit is contained in:
Rouven Seifert 2023-05-29 13:31:20 +02:00
parent 747b917732
commit 1c023fa7af
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
6 changed files with 71 additions and 33 deletions

View file

@ -23,23 +23,17 @@
efi.efiSysMountPoint = "/boot/efi";
};
kernelPackages = pkgs.linuxPackages_latest;
#tmpOnTmpfs = true;
};
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
console = {
keyMap = "dvorak";
};
virtualisation.docker.enable = true;
environment.systemPackages = with pkgs; [
vim
wget
htop-vim
helix
docker-compose
lsof
];
programs.git = {
@ -50,6 +44,7 @@
};
};
services.qemuGuest.enable = true;
systemd.services.qemu-guest-agent.path = [ pkgs.shadow ]; # fix root password reset
# Enable the OpenSSH daemon.
services.openssh = {

View file

@ -6,6 +6,10 @@ in
sops.secrets."purge/environment".owner = "purge";
services.purge = {
enable = true;
discord = {
clientId = "941041925216157746";
publicKey = "d2945f6130d9b4a8dda8c8bf52db5dee127a82f89c6b8782e84aa8f45f61d402";
};
environmentFile = config.sops.secrets."purge/environment".path;
};
services.nginx.virtualHosts."${domain}" = {

View file

@ -1,10 +1,28 @@
{ config, ... }:
{ config, pkgs, ... }:
let
domain = "trucksimulatorbot.rfive.de";
in
{
services.trucksimulatorbot = {
images.enable = true;
enable = true;
listenPort = 9033;
discord = {
clientId = "831052837353816066";
publicKey = "faa7004a2a5096702f96f3ebeb45c7e8272c119b72c1a0894abc4d76d8cc8bad";
};
};
services.mysql = {
enable = true;
package = pkgs.mariadb;
ensureUsers = [
{
name = "trucksimulator";
ensurePermissions = {
"trucksimulator.*" = "ALL PRIVILEGES";
};
}
];
ensureDatabases = [ "trucksimulator" ];
};
services.nginx.virtualHosts = {
"images.${domain}" = {
@ -19,9 +37,8 @@ in
forceSSL = true;
locations."/invite".return = " 301 https://discord.com/api/oauth2/authorize?client_id=831052837353816066&permissions=262144&scope=bot%20applications.commands";
locations."/" = {
proxyPass = "http://127.0.0.1:9000";
proxyPass = "http://127.0.0.1:${toString config.services.trucksimulatorbot.listenPort}";
};
};
};
}