containerize minecraft?
This commit is contained in:
100
system-config/services/containers/minecraft/default.nix
Normal file
100
system-config/services/containers/minecraft/default.nix
Normal file
@@ -0,0 +1,100 @@
|
||||
{ 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 {
|
||||
|
||||
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 = {
|
||||
|
||||
bedrock = {
|
||||
enable = true;
|
||||
package = pkgs.fabricServers.fabric-1_21_8;
|
||||
serverProperties = {
|
||||
server-port = 25565;
|
||||
gamemode = "survival";
|
||||
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;
|
||||
symlinks = {
|
||||
"mods" = ./bedrock;
|
||||
};
|
||||
};
|
||||
|
||||
modded = {
|
||||
enable = true;
|
||||
#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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user