add mc group and gamerule
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 27s

This commit is contained in:
Satria 2026-05-09 20:40:07 +07:00
commit 2844bce5a3
2 changed files with 15 additions and 4 deletions

View file

@ -1,11 +1,13 @@
{ inputs, lib, pkgs, ... }: let { inputs, lib, pkgs, ... }: let
ram-allocation-mb = 12288; ram-allocation-mb = 12288;
rcon-pass = "howdy";
modpack = let modpack = let
commit = "9241d6b4642239a6dfb5629ddb822a127bf93dff"; commit = "9241d6b4642239a6dfb5629ddb822a127bf93dff";
in pkgs.fetchPackwizModpack { in pkgs.fetchPackwizModpack {
packHash = "sha256-GwXJf81iXuEEQeg97nKxzGG/dYl9l8xMW0+mOHRiSAQ="; packHash = "sha256-GwXJf81iXuEEQeg97nKxzGG/dYl9l8xMW0+mOHRiSAQ=";
url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml";
}; };
in { in {
imports = [ inputs.mc.nixosModules.minecraft-servers ]; imports = [ inputs.mc.nixosModules.minecraft-servers ];
nixpkgs.overlays = [ inputs.mc.overlay ]; nixpkgs.overlays = [ inputs.mc.overlay ];
@ -51,6 +53,16 @@ in {
"-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M"
]; in lib.concatStringsSep " " flags; ]; in lib.concatStringsSep " " flags;
extraStartPost = let gamerules = {
"locator_bar" = false;
"mob_explosion_drop_decay" = false;
# "reduced_debug_info" = false;
# "global_sound_events" = false;
}; in lib.concatStringsSep "\n" (map
(rule: "rcon-cli --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}")
(lib.attrNames gamerules)
);
serverProperties = { serverProperties = {
server-port = 25565; server-port = 25565;
server-name = "Minecraft Server"; server-name = "Minecraft Server";
@ -78,16 +90,14 @@ in {
enable-rcon = true; enable-rcon = true;
sync-chunk-writes = false; sync-chunk-writes = false;
"rcon.password" = "howdy"; "rcon.password" = rcon-pass;
"rcon.port" = 25575; "rcon.port" = 25575;
}; };
symlinks = { symlinks = {
# "server-icon.png" = "${modpack}/server-icon.png";
# "resources/datapack/required" = "${modpack}/datapacks"; # "resources/datapack/required" = "${modpack}/datapacks";
"mods" = "${modpack}/mods"; "mods" = "${modpack}/mods";
# "server-icon.png" = "${modpack}/server-icon.png";
# "config" = "";
}; };
}; };
}; };

View file

@ -7,6 +7,7 @@
shell = pkgs.zsh; shell = pkgs.zsh;
extraGroups = [ extraGroups = [
"networkmanager" "networkmanager"
"minecraft"
"wheel" "wheel"
"dialout" "dialout"
"libvirtd" "libvirtd"