Compare commits

...

6 commits

Author SHA1 Message Date
Tristan Daniël Maat a66eac3b17
minecraft: Add automatic restart scheduling
This starts/stops the server at 2 pm and 4 am respectively. This
should hopefully fix some of the issues caused by shoddy programming.
2021-08-27 18:10:19 +01:00
Tristan Daniël Maat 6bc37ebdae
minecraft: Limit to a single core instead of limiting the quota
Minecraft is anyway supposed to be single-threaded, so if it goes
beyond one core something is very wrong.
2021-08-27 18:09:43 +01:00
Tristan Daniël Maat 4fe3b8b22b
minecraft: Fix ridiculous CPU usage
Tapes over https://bugs.mojang.com/browse/MC-183518, which schedules
things completely stupidly on Linux starting with 1.14.
2021-08-25 20:06:05 +01:00
Tristan Daniël Maat 64057828cb
minecraft: Fix forge server curl command 2021-08-24 00:31:35 +01:00
Tristan Daniël Maat b7d0d7521c
flake.lock: Update
Flake input changes:

* Updated 'flake-utils': 'github:numtide/flake-utils/7d706970d94bc5559077eb1a6600afddcd25a7c8' -> 'github:numtide/flake-utils/997f7efcb746a9c140ce1f13c72263189225f482'
* Updated 'nixos-hardware': 'github:nixos/nixos-hardware/fccbee72df707c3fb074854668deee6e1ff02351' -> 'github:nixos/nixos-hardware/de40acde6c056a7c5f3c9ad4dca0c172fa35d207'
* Updated 'nixpkgs': 'github:nixos/nixpkgs/5de44c15758465f8ddf84d541ba300b48e56eda4' -> 'github:nixos/nixpkgs/a1007637cea374bd1bafd754cfd5388894c49129'
2021-08-24 00:02:47 +01:00
Tristan Daniël Maat 6b85b9523c
minecraft: Enable command blocks to fix ice and fire ores 2021-08-21 00:20:20 +01:00
5 changed files with 41 additions and 10 deletions

View file

@ -20,6 +20,8 @@
trustedUsers = [ "@wheel" ]; trustedUsers = [ "@wheel" ];
}; };
boot.kernelParams = [ "highres=off" "nohz=off" ];
networking = { networking = {
hostName = "tlaternet"; hostName = "tlaternet";

View file

@ -5,7 +5,7 @@ allow-nether=true
broadcast-console-to-ops=true broadcast-console-to-ops=true
broadcast-rcon-to-ops=true broadcast-rcon-to-ops=true
difficulty=normal difficulty=normal
enable-command-block=false enable-command-block=true
enable-jmx-monitoring=false enable-jmx-monitoring=false
enable-query=false enable-query=false
enable-rcon=false enable-rcon=false

View file

@ -90,6 +90,7 @@ in {
}; };
}; };
extraOptions = [ "--cpus=1.0" ];
autoStart = false; autoStart = false;
ports = [ "25565:25565" ]; ports = [ "25565:25565" ];
volumes = [ volumes = [
@ -101,4 +102,31 @@ in {
"${whitelist}:/var/lib/minecraft/whitelist.json:ro" "${whitelist}:/var/lib/minecraft/whitelist.json:ro"
]; ];
}; };
systemd.timers.podman-minecraft-voor-kia-off = {
description = "Turns off the minecraft server every day at 4 am";
wantedBy = [ "podman-minecraft-voor-kia.service" ];
timerConfig = {
Unit = "podman-minecraft-voor-kia-starter@stop.service";
OnCalendar = "04:00:00";
};
};
systemd.timers.podman-minecraft-voor-kia-on = {
description = "Turns on the minecraft server every day at 2 pm";
wantedBy = [ "podman-minecraft-voor-kia.service" ];
timerConfig = {
Unit = "podman-minecraft-voor-kia-starter@start.service";
OnCalendar = "14:00:00";
};
};
systemd.services."podman-minecraft-voor-kia-starter@" = {
description = "Unit to stop/start the minecraft server";
serviceConfig = {
ExecStart =
"${pkgs.systemd}/bin/systemctl %i podman-minecraft-voor-kia.service";
Type = "oneshot";
};
};
} }

View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1622445595, "lastModified": 1629481132,
"narHash": "sha256-m+JRe6Wc5OZ/mKw2bB3+Tl0ZbtyxxxfnAWln8Q5qs+Y=", "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "7d706970d94bc5559077eb1a6600afddcd25a7c8", "rev": "997f7efcb746a9c140ce1f13c72263189225f482",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -37,11 +37,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1623143341, "lastModified": 1629744693,
"narHash": "sha256-a8NjpJVvJkb3ehu/KP1OaWwlRexom2D7lQEH5uCO9yA=", "narHash": "sha256-guZxgF5v8Avqpdu5M/F3ygZ4f67Y6ruS7y2kA5yUhZE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "fccbee72df707c3fb074854668deee6e1ff02351", "rev": "de40acde6c056a7c5f3c9ad4dca0c172fa35d207",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -53,11 +53,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1622922048, "lastModified": 1629379628,
"narHash": "sha256-nTyKxe0n7l/4HSmYaIN+63WQrvHrTJY6drSwP7bMqhU=", "narHash": "sha256-dI8wpEo7wIVWoTUk2oyWFUnlVHNKLs+ren1TqITN1mI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5de44c15758465f8ddf84d541ba300b48e56eda4", "rev": "a1007637cea374bd1bafd754cfd5388894c49129",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -7,6 +7,7 @@ let
mirror = "https://files.minecraftforge.net/maven/net/minecraftforge/forge"; mirror = "https://files.minecraftforge.net/maven/net/minecraftforge/forge";
src = fetchurl { src = fetchurl {
url = "${mirror}/${version}/forge-${version}-installer.jar"; url = "${mirror}/${version}/forge-${version}-installer.jar";
curlOpts = "--globoff";
# Forge doesn't seem to like newer shas # Forge doesn't seem to like newer shas
sha1 = "e97821e5431bdcaa46e12048769922e2cdb5e2e1"; sha1 = "e97821e5431bdcaa46e12048769922e2cdb5e2e1";
}; };