nixos-configs/devices/servivi/modules/minecraft.nix

187 lines
4.8 KiB
Nix
Raw Normal View History

{
config,
nms,
pkgs,
self,
...
}: let
inherit (config.vars) mainUser;
in {
imports = [nms.nixosModules.default];
2024-01-30 21:04:11 -05:00
environment.systemPackages = [
self.packages.${pkgs.system}.curseforge-server-downloader
2024-01-30 21:04:11 -05:00
];
systemd.services.mc-steampunk.path = with pkgs; [curl];
services = {
2024-01-04 03:39:14 -05:00
borgbackup.configs.mc = {
paths = ["/var/lib/minecraft"];
startAt = "01/3:00";
2024-01-04 03:39:14 -05:00
};
modded-minecraft-servers = {
eula = true;
user = mainUser;
instances = let
jre17 = pkgs.temurin-bin-17;
jre18 = pkgs.temurin-bin-18;
2024-06-23 15:51:15 -04:00
jre21 = pkgs.temurin-bin-21;
defaults = {
spawn-protection = 0;
max-tick-time = 5 * 60 * 1000;
allow-flight = true;
};
in {
# Vanilla Survival
sv = {
enable = true;
jvmMaxAllocation = "10G";
jvmInitialAllocation = "2G";
2024-06-23 15:51:15 -04:00
jvmPackage = jre21;
jvmOpts = "";
serverConfig =
{
server-port = 25569;
2024-06-23 15:51:15 -04:00
motd = "1.21 gaming";
extra-options = {
difficulty = "hard";
enable-command-block = true;
max-players = 10;
view-distance = 16;
level-seed = "8764718009920";
};
}
// defaults;
};
# Vanilla Creative
cv = {
enable = true;
jvmMaxAllocation = "8G";
jvmInitialAllocation = "2G";
2024-06-23 16:57:20 -04:00
jvmPackage = jre21;
jvmOpts = "";
serverConfig =
{
server-port = 25566;
motd = "creative mode gaming";
extra-options = {
difficulty = "hard";
enable-command-block = true;
2024-02-18 17:51:17 -05:00
enforce-white-list = true;
gamemode = "creative";
max-players = 6;
view-distance = 16;
};
}
// defaults;
};
2024-01-30 21:04:11 -05:00
# Modded https://www.curseforge.com/minecraft/modpacks/steam-punk
# curseforge-server-downloader --pack 643605 --version latest
steampunk = {
enable = false;
2024-01-30 21:04:11 -05:00
jvmMaxAllocation = "12G";
jvmInitialAllocation = "2G";
jvmPackage = jre18;
jvmOpts = "";
serverConfig =
{
server-port = 25569;
2024-01-30 21:04:11 -05:00
motd = "";
extra-options = {
2024-01-30 21:04:11 -05:00
allow-nether = true;
enable-command-block = true;
enable-status = true;
entity-broadcast-range-percentage = 100;
force-gamemode = false;
function-permission-level = 2;
gamemode = "survival";
generate-structures = true;
max-build-height = 256;
max-players = 8;
2024-01-30 21:04:11 -05:00
difficulty = "normal";
view-distance = 12;
simulation-distance = 10;
2024-01-30 21:04:11 -05:00
sync-chunk-writes = true;
use-native-transport = true;
};
}
// defaults;
};
2023-12-27 15:36:42 -05:00
2024-02-18 17:51:17 -05:00
# Modded https://www.curseforge.com/minecraft/modpacks/ultimate-building-modpack
# With https://www.curseforge.com/minecraft/mc-mods/bits-and-chisels
builder = {
enable = false;
2024-02-18 17:51:17 -05:00
jvmMaxAllocation = "6G";
jvmInitialAllocation = "2G";
jvmPackage = jre18;
jvmOpts = "";
serverConfig =
{
server-port = 25567;
2024-02-18 17:51:17 -05:00
motd = "creative mode gaming with mods";
extra-options = {
generate-structures = false;
level-type = "minecraft:flat";
difficulty = "hard";
enable-command-block = true;
enforce-white-list = false;
gamemode = "creative";
max-players = 6;
view-distance = 16;
};
}
// defaults;
};
2023-12-27 15:36:42 -05:00
# Vault Hunters
vh = {
enable = false;
jvmMaxAllocation = "12G";
jvmInitialAllocation = "2G";
jvmPackage = jre17;
jvmOpts = "";
serverConfig =
{
server-port = 25569;
motd = "we do a little hunting of the vaults";
extra-options = {
difficulty = "hard";
enable-command-block = true;
entity-broadcast-range-percentage = 150;
level-type = "default";
max-players = 8;
spawn-protection = 0;
sync-chunk-writes = true;
use-native-transport = true;
view-distance = 10;
};
}
// defaults;
2023-12-27 15:36:42 -05:00
};
};
};
};
}