{ config, lib, pkgs, inputs, ... }: { options.sysconfig.opts.virtualization.minecraft.enable = lib.options.mkOption { type = lib.types.bool; default = false; }; config = lib.mkIf config.sysconfig.opts.virtualization.minecraft.enable { networking.firewall.allowedTCPPorts = [ 25565 ]; containers.minecraft = { autoStart = true; privateNetwork = true; hostAddress = "192.168.100.10"; localAddress = "192.168.100.29"; forwardPorts = [ { containerPort = 25565; hostPort = 25565; } { containerPort = 25566; hostPort = 25566; } ]; config = { imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; environment.systemPackages = with pkgs; [ tmux ]; services.minecraft-servers = { enable = true; eula = true; openFirewall = true; dataDir = "/var/lib/mcservers"; #managementSystem.systemd-socket.enable = true; #temp servers = { vanilla = { enable = true; package = pkgs.fabricServers.fabric-1_21_8; serverProperties = { server-port = 25565; gamemode = "survival"; difficulty = 2; white-list = true; motd = "Didn't see that coming huh?"; }; whitelist = { "MeasureTwice66" = "a4032062-293d-484d-a790-9f52475836bb"; "651sonic" = "936a3fb0-4548-4557-975b-7794e97a3afc"; "Griffin12_" = "6a1f56d9-f712-4723-a031-e5437a389bb3"; }; autoStart = true; }; modded = { enable = false; #package = pkgs.fabricServers.fabric-1_21_1.override { loaderVersion = "0.16.14"; }; package = pkgs.fabricServers.fabric-1_21_1; jvmOpts = [ "-Xms8000M" "-Xmx12000M" ]; serverProperties = { server-port = 25566; gamemode = "survival"; white-list = true; allow-flight = true; motd = "Ex-plo-sion!!!"; }; whitelist = { "MeasureTwice66" = "a4032062-293d-484d-a790-9f52475836bb"; "651sonic" = "936a3fb0-4548-4557-975b-7794e97a3afc"; "Griffin12_" = "6a1f56d9-f712-4723-a031-e5437a389bb3"; }; autoStart = true; symlinks = { "mods" = ./mods; }; }; }; }; system.stateVersion = "25.05"; }; }; }; }