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

87 lines
1.8 KiB
Nix
Raw Normal View History

{
config,
minix,
pkgs,
...
}: let
inherit (config.vars) mainUser;
in {
imports = [minix.nixosModules.default];
2024-01-30 21:04:11 -05:00
environment.systemPackages = [
minix.packages.${pkgs.system}.curseforge-server-downloader
2024-01-30 21:04:11 -05:00
];
services = {
2024-01-04 03:39:14 -05:00
borgbackup.configs.mc = {
paths = ["/var/lib/minix"];
startAt = "01/3:00";
2024-01-04 03:39:14 -05:00
};
minix = {
eula = true;
user = mainUser;
instances = let
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;
serverConfig =
{
server-port = 25569;
2024-06-23 15:51:15 -04:00
motd = "1.21 gaming";
extra-options = {
difficulty = "hard";
enable-command-block = true;
enforce-white-list = 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;
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;
};
};
};
};
}