2021-05-03 12:01:09 +00:00
|
|
|
# Minecraft server configuration for NixOS / NixOps
|
|
|
|
|
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
2021-06-07 12:23:58 +00:00
|
|
|
imports = [ ../secrets/minecraftServer.nix ];
|
|
|
|
|
2021-11-16 04:57:23 +00:00
|
|
|
nixpkgs = { config = { allowUnfree = true; }; };
|
2021-05-03 12:01:09 +00:00
|
|
|
|
|
|
|
services.minecraft-server = {
|
2021-11-16 04:57:23 +00:00
|
|
|
enable = true; # Enable the Minecraft server.
|
2021-05-25 06:07:37 +00:00
|
|
|
declarative = true;
|
2021-11-16 04:57:23 +00:00
|
|
|
eula = true; # Answer Miecraft's EULA
|
2021-05-03 12:01:09 +00:00
|
|
|
openFirewall = true;
|
|
|
|
serverProperties = {
|
|
|
|
motd = "mcwhirter.io";
|
|
|
|
white-list = true;
|
2021-06-07 07:25:43 +00:00
|
|
|
enable-command-block = true;
|
2021-05-25 06:07:37 +00:00
|
|
|
enable-rcon = true;
|
|
|
|
"rcon.password" = "hunter2";
|
2021-05-03 12:01:09 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-11-16 04:57:23 +00:00
|
|
|
environment.systemPackages = with pkgs;
|
|
|
|
[
|
|
|
|
mcron # Minecraft console client
|
|
|
|
];
|
2021-05-03 12:01:09 +00:00
|
|
|
}
|