mod: exposed some more options

This commit is contained in:
wymiller committed 2026-10-31 09:31:25 -04:00
1 parent 3ba8f51b16
commit b146700a70
3 files changed
+57 -5

No files matched your search

+36 -3
View File
@@ -56,18 +56,51 @@ recreated on each start and removed on stop by nix-minecraft. Edits to those
copies do not persist across restarts. World data is not part of those managed
directories.
Change the Minecraft port in `modules/machine/krile/configuration.nix`:
```nix
services.homestead.port = 25566;
```
The default is TCP 25565. When `services.homestead.openFirewall = true`, the
opened TCP port follows this setting. Update your router's port forwarding and
connect with `krile:25566` (or your server's address). Voice chat remains on
UDP 24454, matching the pack's `config/voicechat/voicechat-server.properties`.
Rebuild krile to apply the change.
Change memory in the host configuration:
```nix
services.homestead.jvmOpts = "-Xms6G -Xmx12G -XX:+UseG1GC";
```
Declare operators in the host configuration:
```nix
services.homestead.operators = {
"YourMinecraftName" = {
uuid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
level = 4;
bypassesPlayerLimit = false;
};
};
```
Replace the example name and UUID with the player's actual Minecraft account
details. A UUID string also works as a shorthand:
`services.homestead.operators."YourMinecraftName" = "your-player-uuid";`.
It defaults to permission level 4 and does not bypass the player limit.
After rebuilding krile, nix-minecraft generates
`/srv/minecraft/homestead/ops.json` when the server starts. A nonempty operator
list replaces the file on each start, so changes made with `/op` or `/deop` do
not persist across restarts. The default `{ }` leaves `ops.json` unmanaged.
Other server settings use the underlying nix-minecraft options:
```nix
services.minecraft-servers.servers.homestead = {
serverProperties = {
server-port = 25566;
max-players = 10;
white-list = true;
};
@@ -76,8 +109,8 @@ services.minecraft-servers.servers.homestead = {
};
```
Changing `server-port` also changes the opened TCP port. Voice chat remains on
UDP 24454, matching the pack's `config/voicechat/voicechat-server.properties`.
The underlying `serverProperties.server-port` setting can still override
`services.homestead.port`; the opened TCP port follows the effective value.
To use this module on another NixOS host, pass `nur` in `specialArgs`, import
`modules/games/homestead`, set `services.homestead.enable = true`, and set
+19 -2
View File
@@ -2,6 +2,7 @@
config,
lib,
nur,
options,
pkgs,
...
}:
@@ -15,12 +16,28 @@ in
options.services.homestead = {
enable = lib.mkEnableOption "the Homestead 2.0 Minecraft server";
port = lib.mkOption {
type = lib.types.port;
default = 25565;
description = "TCP port for the Homestead Minecraft server.";
};
openFirewall = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Open the Minecraft TCP port and Simple Voice Chat UDP port (24454).";
};
operators = lib.mkOption {
type = (options.services.minecraft-servers.servers.type.getSubOptions [ ]).operators.type;
default = { };
description = ''
Server operators keyed by Minecraft username. Values may be UUID strings
or attribute sets with uuid, level, and bypassesPlayerLimit. A nonempty
value manages ops.json declaratively; an empty value leaves it unmanaged.
'';
};
jvmOpts = lib.mkOption {
type = lib.types.str;
default = "-Xms6G -Xmx10G -XX:+UseG1GC";
@@ -35,7 +52,7 @@ in
enable = true;
servers.homestead = {
enable = true;
inherit (cfg) openFirewall jvmOpts;
inherit (cfg) openFirewall operators jvmOpts;
package = pkgs.fabricServers.fabric-1_20_1.override {
loaderVersion = "0.19.5";
@@ -54,7 +71,7 @@ in
max-tick-time = 180000;
simulation-distance = 6;
view-distance = 10;
server-port = 25565;
server-port = cfg.port;
online-mode = true;
# keep-inventory = true;
};
+2
View File
@@ -80,7 +80,9 @@
services.homestead = {
enable = true;
port = 25565;
openFirewall = true;
operators = { };
};
services.minecraft-servers.eula = true;