chore: update server + refactor
This commit is contained in:
parent
23d1a07f26
commit
f4ac9c1753
2 changed files with 31 additions and 25 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -494,11 +494,11 @@
|
|||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1749175420,
|
||||
"narHash": "sha256-5gOh2Jpp7HLzyV3RVkIS88F9lhpnTpsCzOu8J1w7Uuo=",
|
||||
"lastModified": 1749780394,
|
||||
"narHash": "sha256-KZypZIU6L2EJRej+nBm5IuW6Q8nfccvylXWMkfhHTCA=",
|
||||
"owner": "Infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "ad263175ac965617a3fe4b3d46e1fcabb4964f51",
|
||||
"rev": "4f330afee93356ceedf61c772f9a296388db76aa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
...
|
||||
}: let
|
||||
modpack = pkgs.fetchPackwizModpack rec {
|
||||
version = "7091175";
|
||||
version = "4d507be";
|
||||
url = "https://raw.githubusercontent.com/sajenim/minecraft-modpack/${version}/pack.toml";
|
||||
packHash = "sha256-9HZipG6/8GKnbXp0Qfug8Y2Db96hageUtprAuuuuGPM=";
|
||||
packHash = "sha256-1Za6ZSLVE6jbwlqkJriQNvuoFAnOVz76t8BWtR6al7o=";
|
||||
};
|
||||
mcVersion = modpack.manifest.versions.minecraft;
|
||||
fabricVersion = modpack.manifest.versions.fabric;
|
||||
|
@ -46,7 +46,7 @@ in {
|
|||
serverProperties = {
|
||||
gamemode = "survival";
|
||||
difficulty = "normal";
|
||||
motd = "\\u00A7aKanto Network \\u00A7e[1.19.2]\\u00A7r\\n\\u00A78I'll Use My Trusty Frying Pan As A Drying Pan!";
|
||||
motd = "\\u00A7aKanto Network \\u00A7e[1.20.1]\\u00A7r\\n\\u00A78I'll Use My Trusty Frying Pan As A Drying Pan!";
|
||||
server-port = 25565;
|
||||
white-list = true;
|
||||
spawn-protection = 0;
|
||||
|
@ -61,9 +61,6 @@ in {
|
|||
# Things to copy into this server's data directory.
|
||||
files = {
|
||||
"ops.json" = ./ops.json;
|
||||
|
||||
# Youre in grave danger
|
||||
"config/yigd.toml" = "${modpack}/config/yigd.toml";
|
||||
};
|
||||
|
||||
# Value of systemd's `Restart=` service configuration option.
|
||||
|
@ -77,11 +74,18 @@ in {
|
|||
# Open firewall for all servers.
|
||||
openFirewall = true;
|
||||
|
||||
# https://account.mojang.com/documents/minecraft_eula
|
||||
# Enable systemd socket activation.
|
||||
managementSystem.systemd-socket.enable = true;
|
||||
|
||||
# Accept the minecraft EULA.
|
||||
eula = true;
|
||||
# https://account.mojang.com/documents/minecraft_eula
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions.http.routers = {
|
||||
# Enable the Traefik reverse proxy.
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
# Enable the Traefik HTTP router for the minecraft server.
|
||||
routers = {
|
||||
minecraft = {
|
||||
rule = "Host(`mc.home.arpa`)";
|
||||
entryPoints = [
|
||||
|
@ -90,13 +94,14 @@ in {
|
|||
service = "minecraft";
|
||||
};
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions.http.services = {
|
||||
# Define the service for the minecraft server.
|
||||
services = {
|
||||
minecraft.loadBalancer.servers = [
|
||||
{url = "http://127.0.0.1:${toString config.services.minecraft-servers.servers.kanto.serverProperties.server-port}";}
|
||||
];
|
||||
};
|
||||
|
||||
# Enable persistence for the data directory.
|
||||
environment.persistence."/persist" = {
|
||||
directories = [
|
||||
{
|
||||
|
@ -107,6 +112,7 @@ in {
|
|||
];
|
||||
};
|
||||
|
||||
# Allow unfree packages.
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
"minecraft-server"
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue