added minecraft server. Backup solution is a bit ugly ATM.

This commit is contained in:
Gabe Venberg 2025-04-11 23:38:32 +02:00
parent 39bee826c3
commit 10289cb930
8 changed files with 94 additions and 9 deletions

View file

@ -6,10 +6,10 @@
}: {
programs.yazi.enable = true;
# optional dependencies for yazi.
programs={
fzf.enable=true;
ripgrep.enable=true;
zoxide.enable=true;
programs = {
fzf.enable = true;
ripgrep.enable = true;
zoxide.enable = true;
};
home.packages = with pkgs; [
ffmpeg

View file

@ -5,6 +5,9 @@
lib,
...
}: {
virtualisation.docker.enable = true;
virtualisation.docker = {
enable = true;
autoPrune.enable = true;
};
users.users.${config.host.user}.extraGroups = ["docker"];
}

View file

@ -13,7 +13,6 @@
hostname = "factorio";
ports = [
"34197:34197/udp"
"27015:27015/tcp"
];
environment = {UPDATE_MODS_ON_START = "true";};
};

View file

@ -0,0 +1,48 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
virtualisation.oci-containers = {
backend = "docker";
containers.minecraft = {
image = "itzg/minecraft-server";
volumes = ["/storage/minecraft:/data"];
hostname = "minecraft";
ports = [
"25565:25565"
];
environment = {
EULA = "TRUE";
TYPE = "FORGE";
VERSION = "1.20.1";
PACKWIZ_URL = "https://static.venberg.xyz/minecraft/less-than-compact-2/pack.toml";
MEMORY = "16G";
USE_AIKAR_FLAGS = "true";
UID = "1000";
GID = "100";
STOP_SERVER_ANNOUNCE_DELAY = "30";
ENABLE_ROLLING_LOGS = "true";
GUI = "FALSE";
# SETUP_ONLY = "true";
MOTD = "Welcome!";
DIFFICULTY = "normal";
OPS = ''
TheToric
'';
ENFORCE_WHITELIST = "true";
ENABLE_WHITELIST = "true";
ANNOUNCE_PLAYER_ACHIEVEMENTS = "true";
ALLOW_FLIGHT = "TRUE";
ENABLE_AUTOPAUSE = "true";
MAX_TICK_TIME = "-1";
};
extraOptions = ["--stop-timeout=60"];
};
};
imports = [
./docker.nix
];
}

View file

@ -25,7 +25,7 @@ in {
];
};
};
services.nginx.virtualHosts."static.venberg.xyz" = {
services.nginx.virtualHosts."directory.venberg.xyz" = {
enableACME = true;
forceSSL = true;
locations."/" = {

View file

@ -0,0 +1,13 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
services.nginx.virtualHosts."static.venberg.xyz" = {
enableACME = true;
forceSSL = true;
root = "/storage/static";
};
}