From 00cc68b7cc21a1089f06eba8f129b7540a540473 Mon Sep 17 00:00:00 2001 From: satr14 Date: Thu, 7 May 2026 22:37:08 +0700 Subject: [PATCH 01/58] init --- modules/system/homelab/mc-backup.nix | 103 +++++++++++++++++++++++++++ modules/system/server.nix | 1 + 2 files changed, 104 insertions(+) create mode 100644 modules/system/homelab/mc-backup.nix diff --git a/modules/system/homelab/mc-backup.nix b/modules/system/homelab/mc-backup.nix new file mode 100644 index 0000000..1a2cb96 --- /dev/null +++ b/modules/system/homelab/mc-backup.nix @@ -0,0 +1,103 @@ +{ pkgs, ... }: let + serverName = "mc0-explorers-creativity"; + serviceName = "minecraft-server-${serverName}"; + backupDir = "/mnt/data/backups/mc"; + keepBackups = 7; # number of backups to retain + rconHost = "localhost"; + rconPort = "25575"; + rconPassword = "howdy"; + ntfyUrl = "http://127.0.0.1:8067"; + ntfyTopic = "mc-backup"; + + backupScript = pkgs.writeShellScriptBin "mc-backup" '' + set -euo pipefail + + rcon() { + ${pkgs.rcon-cli}/bin/rcon-cli --address "${rconHost}:${rconPort}" --password "${rconPassword}" "$@" || true + } + + BACKUP_OK=false + + on_exit() { + # Always restart the server first + echo "[mc-backup] Restarting server..." + systemctl start ${serviceName}.service + + # Notify via ntfy only on failure + if [ "$BACKUP_OK" != "true" ]; then + echo "[mc-backup] Sending failure notification..." + ${pkgs.curl}/bin/curl -s -o /dev/null \ + -H "Title: Minecraft Backup Failed" \ + -H "Priority: high" \ + -H "Tags: warning" \ + -d "Nightly backup failed at $(date '+%Y-%m-%d %H:%M:%S'). Check logs with: journalctl -u mc-backup -n 50" \ + "${ntfyUrl}/${ntfyTopic}" + fi + } + + # Always restart the server on exit, even if the script fails mid-backup + trap on_exit EXIT + + # --- Countdown warnings via RCON --- + echo "[mc-backup] Sending 5-minute warning..." + rcon "say §c[Backup] §fServer will restart in §e5 minutes §ffor a scheduled backup." + + sleep 240 + + echo "[mc-backup] Sending 1-minute warning..." + rcon "say §c[Backup] §fServer restarting in §e1 minute§f." + + sleep 50 + + echo "[mc-backup] Sending 10-second warning..." + rcon "say §c[Backup] §fServer restarting in §e10 seconds§f." + + sleep 10 + + rcon "say §c[Backup] §fShutting down now. Back shortly!" + + # --- Save world & stop --- + echo "[mc-backup] Saving world..." + rcon "save-all" + sleep 5 + + echo "[mc-backup] Stopping ${serviceName}..." + systemctl stop ${serviceName}.service + + # --- Backup --- + echo "[mc-backup] Backing up to ${backupDir}..." + mkdir -p "${backupDir}" + TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S) + XZ_OPT="-9e" tar -cJf "${backupDir}/mc-backup-$TIMESTAMP.tar.xz" \ + -C /srv/minecraft ${serverName} + + # Prune old backups, keeping the last ${toString keepBackups} + ls -t "${backupDir}"/mc-backup-*.tar.xz | tail -n +${toString (keepBackups + 1)} | xargs -r rm -- + + echo "[mc-backup] Backup complete: mc-backup-$TIMESTAMP.tar.xz" + BACKUP_OK=true + # Server restart is handled by the EXIT trap above + ''; +in { + environment.systemPackages = [ backupScript ]; + + systemd.services.mc-backup = { + description = "Nightly Minecraft server backup"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${backupScript}/bin/mc-backup"; + User = "root"; + StandardOutput = "journal"; + StandardError = "journal"; + }; + }; + + systemd.timers.mc-backup = { + description = "Nightly Minecraft backup timer"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; # fires at 00:00:00 every day + Persistent = true; # catch up if the machine was off at midnight + }; + }; +} diff --git a/modules/system/server.nix b/modules/system/server.nix index 57a3ff0..0916649 100644 --- a/modules/system/server.nix +++ b/modules/system/server.nix @@ -26,6 +26,7 @@ in { ./homelab/ai.nix ./homelab/db.nix ./homelab/mc.nix + ./homelab/mc-backup.nix ./core/swapfile.nix ./core/oom.nix From 37867492a9856725f69720c91aeb1c4a94a5d22d Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 8 May 2026 16:33:02 +0700 Subject: [PATCH 02/58] performance tweaks (zgc, sysctl, jvmopts, etc) --- modules/system/homelab/mc.nix | 69 ++++++++++++++--------------------- 1 file changed, 27 insertions(+), 42 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 276ab69..4e45400 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,6 +1,5 @@ { inputs, lib, pkgs, ... }: let - ram-allocation = "10240M"; - # auth-server = "https://mc.satr14.my.id"; # TODO: self hosted drasl server + ram-allocation-mb = 12288; modpack = let commit = "667aadf36aac9b0689289f4988a76b924bbb9cbc"; in pkgs.fetchPackwizModpack { @@ -11,6 +10,12 @@ in { imports = [ inputs.mc.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.mc.overlay ]; + powerManagement.cpuFreqGovernor = "schedutil"; + boot.kernel.sysctl = { + "vm.nr_hugepages" = 6656; + "vm.swappiness" = 10; + }; + services.minecraft-servers = { enable = true; eula = true; @@ -21,54 +26,34 @@ in { enable = true; autoStart = true; restart = "always"; - enableReload = false; # NOTE: development phase, disable in production + enableReload = true; # NOTE: development phase, disable in production package = pkgs.fabricServers.fabric-1_21_11.override { - jre_headless = pkgs.javaPackages.compiler.temurin-bin.jre-25; + jre_headless = pkgs.javaPackages.compiler.temurin-bin.jdk-25; loaderVersion = "0.19.2"; }; - jvmOpts = let - flags = [ - "-Xms${ram-allocation}" - "-Xmx${ram-allocation}" - "--add-modules=jdk.incubator.vector" - - # Custom auth server - # "-Dminecraft.api.env=custom" - # "-Dminecraft.api.auth.host=${auth-server}/auth" - # "-Dminecraft.api.account.host=${auth-server}/account" - # "-Dminecraft.api.profiles.host=${auth-server}/account" - # "-Dminecraft.api.session.host=${auth-server}/session" - # "-Dminecraft.api.services.host=${auth-server}/services" + jvmOpts = let flags = [ + "-Xms${toString ram-allocation-mb}M" + "-Xmx${toString ram-allocation-mb}M" - # Aikar's GC flags (tuned for 10GB) - "-XX:+UseG1GC" - "-XX:+ParallelRefProcEnabled" - "-XX:MaxGCPauseMillis=200" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+DisableExplicitGC" - "-XX:+AlwaysPreTouch" - "-XX:G1HeapWastePercent=5" - "-XX:G1MixedGCCountTarget=4" - "-XX:InitiatingHeapOccupancyPercent=15" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1RSetUpdatingPauseTimePercent=5" - "-XX:SurvivorRatio=32" - "-XX:+PerfDisableSharedMem" - "-XX:MaxTenuringThreshold=1" - "-Dusing.aikars.flags=https://mcflags.emc.gs" - "-Daikars.new.flags=true" - "-XX:G1NewSizePercent=30" - "-XX:G1MaxNewSizePercent=40" - "-XX:G1HeapRegionSize=8M" - "-XX:G1ReservePercent=20" - ]; - in lib.concatStringsSep " " flags; + # Exposes SIMD instructions (requires full JDK, useful with performance mods) + "--add-modules=jdk.incubator.vector" + + # ZGC flags (requires Java v25+, 8+ CPU cores, 10GB+ RAM) + "-XX:+UseZGC" + "-XX:+UseLargePages" + "-XX:+AlwaysPreTouch" + "-XX:+DisableExplicitGC" + "-XX:+PerfDisableSharedMem" + "-XX:+UseCompactObjectHeaders" + "-XX:ZAllocationSpikeTolerance=5" + "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" + ]; in lib.concatStringsSep " " flags; serverProperties = { server-port = 25565; - server-name = "Digit Association"; + server-name = "Minecraft Server"; motd = "§lSeason 3 TESTING§r - §dExplorers Creativity 🔥"; difficulty = "normal"; @@ -88,7 +73,7 @@ in { # resource-pack-sha1 = "e0958dcef5755286f390c22280700c471ec34a65"; # resource-pack-enforce = false; - simulation-distance = 16; + simulation-distance = 12; view-distance = 4; enable-rcon = true; From 02c4edc9084d91fd8b69efd25562b9f4b76450cd Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 8 May 2026 19:04:56 +0700 Subject: [PATCH 03/58] add rclone --- modules/system/misc/utilities.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/system/misc/utilities.nix b/modules/system/misc/utilities.nix index de5d35e..a637e8d 100644 --- a/modules/system/misc/utilities.nix +++ b/modules/system/misc/utilities.nix @@ -8,6 +8,7 @@ ntfs3g exfatprogs smartmontools + rclone ncdu ventoy-full-qt From 3afe1f226f41f91d5fe82621b0bfd55ca831aee7 Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 8 May 2026 21:09:20 +0700 Subject: [PATCH 04/58] update modpack and add credits to readme --- README.md | 3 ++- modules/system/homelab/mc.nix | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee0d382..2eb43c0 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,5 @@ - `homelab` - i7 8700T, 32GB RAM, 512GB NVME, 1TB 2.5" SATA ## Credits -- [orangc's flake](https://git.orangc.net/c/dots) \ No newline at end of file +- [orangc's flake](https://git.orangc.net/c/dots) +- [vimjoyer's tutorials](https://www.youtube.com/@vimjoyer) \ No newline at end of file diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 4e45400..eb11851 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,9 +1,9 @@ { inputs, lib, pkgs, ... }: let ram-allocation-mb = 12288; modpack = let - commit = "667aadf36aac9b0689289f4988a76b924bbb9cbc"; + commit = "c82e271f5e8a8067ed62af6e870307459580e812"; in pkgs.fetchPackwizModpack { - packHash = "sha256-sNWuqTIpqnwxhoof5PkJXrvVE5x/wnhc3LoqomjYBNs="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; in { From 73428f1501f29b3b24ae48fe1216734d13a00704 Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 8 May 2026 21:12:56 +0700 Subject: [PATCH 05/58] update fix --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index eb11851..4b3adc6 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,7 +1,7 @@ { inputs, lib, pkgs, ... }: let ram-allocation-mb = 12288; modpack = let - commit = "c82e271f5e8a8067ed62af6e870307459580e812"; + commit = "2465b8364a9dd8166921dbe854c5cc7d530cdc7c"; in pkgs.fetchPackwizModpack { packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; From 05f27f292734a2ff3bdc59581a888a612a5c7324 Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 8 May 2026 21:15:37 +0700 Subject: [PATCH 06/58] update fix 2 --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 4b3adc6..57a23b0 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,7 +1,7 @@ { inputs, lib, pkgs, ... }: let ram-allocation-mb = 12288; modpack = let - commit = "2465b8364a9dd8166921dbe854c5cc7d530cdc7c"; + commit = "d1c0e4d6813e912a861345aa172eb52b83f93da9"; in pkgs.fetchPackwizModpack { packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; From 21f3df0cb42c39e2b71281c4ec8a46511d70fbdc Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 8 May 2026 21:16:40 +0700 Subject: [PATCH 07/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 57a23b0..1e0affc 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -3,7 +3,7 @@ modpack = let commit = "d1c0e4d6813e912a861345aa172eb52b83f93da9"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-qeiJlkMBkTW+WQemGt9W0N+iTgG6TKsq/5YiJuph1Sk="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; in { From e3202701ef094ee3c0db015625b09420983b3ae0 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 14:21:30 +0700 Subject: [PATCH 08/58] wp source --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2eb43c0..9172fc5 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,5 @@ ## Credits - [orangc's flake](https://git.orangc.net/c/dots) -- [vimjoyer's tutorials](https://www.youtube.com/@vimjoyer) \ No newline at end of file +- [vimjoyer's tutorials](https://www.youtube.com/@vimjoyer) +- [wallpaper source](https://github.com/er2de2/catppuccin_walls/blob/master/wallpapers_png/autumn_2.0.png) \ No newline at end of file From 0cdce64701ad540db7ccdbc0f9db29582db95926 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 14:21:45 +0700 Subject: [PATCH 09/58] dynamic large pages and update modpack --- modules/system/homelab/mc.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 1e0affc..8bb9344 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,9 +1,9 @@ { inputs, lib, pkgs, ... }: let ram-allocation-mb = 12288; modpack = let - commit = "d1c0e4d6813e912a861345aa172eb52b83f93da9"; + commit = "476d4e5c08caded28ef0e24193249bec75cf52e6"; in pkgs.fetchPackwizModpack { - packHash = "sha256-qeiJlkMBkTW+WQemGt9W0N+iTgG6TKsq/5YiJuph1Sk="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; in { @@ -12,7 +12,7 @@ in { powerManagement.cpuFreqGovernor = "schedutil"; boot.kernel.sysctl = { - "vm.nr_hugepages" = 6656; + "vm.nr_hugepages" = (ram-allocation-mb / 2) + 512; # (heap_mb / 2MB per page) + 512 pages (1GB) for ZGC off-heap overhead "vm.swappiness" = 10; }; From 81bf3f71187d93a4b3e6746b200e452c12a21e81 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 14:23:15 +0700 Subject: [PATCH 10/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 8bb9344..a017ca8 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -3,7 +3,7 @@ modpack = let commit = "476d4e5c08caded28ef0e24193249bec75cf52e6"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-zO7r8nXsK5Z3EnkUZNVDmPU1xqLI6qbZfS2tw0LLi0Q="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; in { From 59163a8f067fc66cb4fea8699a1833195384426d Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 19:49:35 +0700 Subject: [PATCH 11/58] update modpack include worldgen --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index a017ca8..adbdcf0 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,9 +1,9 @@ { inputs, lib, pkgs, ... }: let ram-allocation-mb = 12288; modpack = let - commit = "476d4e5c08caded28ef0e24193249bec75cf52e6"; + commit = "9241d6b4642239a6dfb5629ddb822a127bf93dff"; in pkgs.fetchPackwizModpack { - packHash = "sha256-zO7r8nXsK5Z3EnkUZNVDmPU1xqLI6qbZfS2tw0LLi0Q="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; in { From 48c4c03b738191211c6a61357b09af9ce3acd34f Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 19:56:01 +0700 Subject: [PATCH 12/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index adbdcf0..9149da2 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -3,7 +3,7 @@ modpack = let commit = "9241d6b4642239a6dfb5629ddb822a127bf93dff"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-GwXJf81iXuEEQeg97nKxzGG/dYl9l8xMW0+mOHRiSAQ="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; in { From 2844bce5a33a83220a8282dffec98b3846545bdb Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 20:40:07 +0700 Subject: [PATCH 13/58] add mc group and gamerule --- modules/system/homelab/mc.nix | 18 ++++++++++++++---- modules/system/user.nix | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 9149da2..42e1e2e 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,11 +1,13 @@ { inputs, lib, pkgs, ... }: let ram-allocation-mb = 12288; + rcon-pass = "howdy"; modpack = let commit = "9241d6b4642239a6dfb5629ddb822a127bf93dff"; in pkgs.fetchPackwizModpack { packHash = "sha256-GwXJf81iXuEEQeg97nKxzGG/dYl9l8xMW0+mOHRiSAQ="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; + in { imports = [ inputs.mc.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.mc.overlay ]; @@ -50,6 +52,16 @@ in { "-XX:ZAllocationSpikeTolerance=5" "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" ]; 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 = { server-port = 25565; @@ -78,16 +90,14 @@ in { enable-rcon = true; sync-chunk-writes = false; - "rcon.password" = "howdy"; + "rcon.password" = rcon-pass; "rcon.port" = 25575; }; symlinks = { + # "server-icon.png" = "${modpack}/server-icon.png"; # "resources/datapack/required" = "${modpack}/datapacks"; "mods" = "${modpack}/mods"; - - # "server-icon.png" = "${modpack}/server-icon.png"; - # "config" = ""; }; }; }; diff --git a/modules/system/user.nix b/modules/system/user.nix index 44910e9..5f50a54 100644 --- a/modules/system/user.nix +++ b/modules/system/user.nix @@ -7,6 +7,7 @@ shell = pkgs.zsh; extraGroups = [ "networkmanager" + "minecraft" "wheel" "dialout" "libvirtd" From 51ea85202650d2e21eed01a51198fb331d638268 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:31:50 +0700 Subject: [PATCH 14/58] update modpack and include datapacks --- modules/system/homelab/mc.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 42e1e2e..cc64bb7 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "9241d6b4642239a6dfb5629ddb822a127bf93dff"; + commit = "c204d7f5891543b9f15b5d6ba9a7904bab93bfde"; in pkgs.fetchPackwizModpack { - packHash = "sha256-GwXJf81iXuEEQeg97nKxzGG/dYl9l8xMW0+mOHRiSAQ="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; @@ -96,7 +96,7 @@ in { symlinks = { # "server-icon.png" = "${modpack}/server-icon.png"; - # "resources/datapack/required" = "${modpack}/datapacks"; + "world/datapacks" = "${modpack}/datapacks"; "mods" = "${modpack}/mods"; }; }; From c48283a6e237a017b4c69525c12893e36e7f0597 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:35:23 +0700 Subject: [PATCH 15/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index cc64bb7..409b5a3 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "c204d7f5891543b9f15b5d6ba9a7904bab93bfde"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-mzUO3/jVS0kLmSEa1MVaVG7+kDwMiOorwGJw0IVCRMk="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From b2ecd770c8e55d82961754665f07298571a52050 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:40:13 +0700 Subject: [PATCH 16/58] fix rcon-cli path --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 409b5a3..0c778cb 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -59,7 +59,7 @@ in { # "reduced_debug_info" = false; # "global_sound_events" = false; }; in lib.concatStringsSep "\n" (map - (rule: "rcon-cli --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") + (rule: "${pkgs.rcon-cli} --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") (lib.attrNames gamerules) ); From 68455e7ce4f7d3400daba6e6ebea5b76797ad6cc Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:41:18 +0700 Subject: [PATCH 17/58] fix bin path --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 0c778cb..9fc0966 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -59,7 +59,7 @@ in { # "reduced_debug_info" = false; # "global_sound_events" = false; }; in lib.concatStringsSep "\n" (map - (rule: "${pkgs.rcon-cli} --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") + (rule: "${pkgs.rcon-cli}/bin/rcon-cli --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") (lib.attrNames gamerules) ); From 7d2be949cad00463c08b81289bc80f52861bdc23 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:43:30 +0700 Subject: [PATCH 18/58] startpost remove --- modules/system/homelab/mc.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 9fc0966..51444c4 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -53,15 +53,16 @@ in { "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" ]; 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: "${pkgs.rcon-cli}/bin/rcon-cli --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") - (lib.attrNames gamerules) - ); + # 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: "${pkgs.rcon-cli}/bin/rcon-cli --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") + # (lib.attrNames gamerules) + # ); + # TODO: figure out how to set gamerules on start (script above runs **before** server ready) serverProperties = { server-port = 25565; From 2740bb817587c5a04b5db9c30bbf9becc4e43922 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:46:33 +0700 Subject: [PATCH 19/58] update modpack --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 51444c4..50a7865 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "c204d7f5891543b9f15b5d6ba9a7904bab93bfde"; + commit = "d2b9f6d5059ec68df3323328dab70a918195e487"; in pkgs.fetchPackwizModpack { - packHash = "sha256-mzUO3/jVS0kLmSEa1MVaVG7+kDwMiOorwGJw0IVCRMk="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From b917409d106facc8d0ce66b80b52bd7968530e77 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:49:38 +0700 Subject: [PATCH 20/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 50a7865..0edebbb 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "d2b9f6d5059ec68df3323328dab70a918195e487"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-p2Lg2VldNcujIcI2DsmwZtZeF6rdAIQzcf0QaEPn15A="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From acf495fae239919577c3701351b7b4b3eb9774ab Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:54:44 +0700 Subject: [PATCH 21/58] update modpack --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 0edebbb..9e77ee5 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,7 +2,7 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "d2b9f6d5059ec68df3323328dab70a918195e487"; + commit = "4da142e626638de11e454db604251dce6cc14c58"; in pkgs.fetchPackwizModpack { packHash = "sha256-p2Lg2VldNcujIcI2DsmwZtZeF6rdAIQzcf0QaEPn15A="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; From 4b6a8a6fa28d534681b43feb80b55818e53355d1 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:56:17 +0700 Subject: [PATCH 22/58] refresh hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 9e77ee5..29fb169 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "4da142e626638de11e454db604251dce6cc14c58"; in pkgs.fetchPackwizModpack { - packHash = "sha256-p2Lg2VldNcujIcI2DsmwZtZeF6rdAIQzcf0QaEPn15A="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From c03567baa351aae858aa28ee28d435795495fb00 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 9 May 2026 23:57:24 +0700 Subject: [PATCH 23/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 29fb169..096c885 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "4da142e626638de11e454db604251dce6cc14c58"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-xpVxreoFVF5e3VidtlqgiIWZYcBy8OY9vrSv3dgV/u8="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From e9306f35153be41bd24ae1db242f7a232951b0dd Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 00:03:51 +0700 Subject: [PATCH 24/58] update modpack --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 096c885..913cc36 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "4da142e626638de11e454db604251dce6cc14c58"; + commit = "a52f65c1234b9f2dbe1392c471cb32a0614c5073"; in pkgs.fetchPackwizModpack { - packHash = "sha256-xpVxreoFVF5e3VidtlqgiIWZYcBy8OY9vrSv3dgV/u8="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 13041a04a5a31aa0145c304075c26d7a908a9533 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 00:06:31 +0700 Subject: [PATCH 25/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 913cc36..fc641c7 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "a52f65c1234b9f2dbe1392c471cb32a0614c5073"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-WplCmvuCmA8TNeRVBKMwkvizmYlBcU9PDugXXSKTBaA="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 0b2ef091ee9c7dd8a7cd9ab1981da47d5c682d59 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 10:43:02 +0700 Subject: [PATCH 26/58] got some things mixed up :p --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index fc641c7..d47f5db 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -86,8 +86,8 @@ in { # resource-pack-sha1 = "e0958dcef5755286f390c22280700c471ec34a65"; # resource-pack-enforce = false; - simulation-distance = 12; - view-distance = 4; + view-distance = 12; + simulation-distance = 4; enable-rcon = true; sync-chunk-writes = false; From 6e02ff9c9c1de4a695ea8c2d6b32e1e0a58fa4f6 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 10:49:39 +0700 Subject: [PATCH 27/58] remove datapacks --- modules/system/homelab/mc.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index d47f5db..505c34f 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -97,7 +97,6 @@ in { symlinks = { # "server-icon.png" = "${modpack}/server-icon.png"; - "world/datapacks" = "${modpack}/datapacks"; "mods" = "${modpack}/mods"; }; }; From 3dc56278c9e83efbbce8206634c14c9d81f08ffa Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 10:50:02 +0700 Subject: [PATCH 28/58] zgc lag from pause fix --- modules/system/homelab/mc.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 505c34f..531253a 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -51,6 +51,10 @@ in { "-XX:+UseCompactObjectHeaders" "-XX:ZAllocationSpikeTolerance=5" "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" + + # High MSPT due to ZGC pauses + "-XX:ZUncommitDelay=300" + "-XX:ZCollectionInterval=5" ]; in lib.concatStringsSep " " flags; # extraStartPost = let gamerules = { From 90ed03a7aeb3cb8d3cde86e261531e02d41bef25 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 11:20:55 +0700 Subject: [PATCH 29/58] update modpack --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 531253a..03171a9 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "a52f65c1234b9f2dbe1392c471cb32a0614c5073"; + commit = "ac9278758cf96b97fbb4f816aca0fb2f94ccf3a2"; in pkgs.fetchPackwizModpack { - packHash = "sha256-WplCmvuCmA8TNeRVBKMwkvizmYlBcU9PDugXXSKTBaA="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 7e2c4b5169971e46a296d9a3428eebffa5fa857f Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 11:27:44 +0700 Subject: [PATCH 30/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 03171a9..18a49a9 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "ac9278758cf96b97fbb4f816aca0fb2f94ccf3a2"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-X9CTYHfGRx6caCHfe+KS6/jhXV5fPCZ9hr8O2tlXus0="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 51b83d617ed394ed0b5533293353f040dae84989 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 18:52:32 +0700 Subject: [PATCH 31/58] update modpack --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 18a49a9..182a82f 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "ac9278758cf96b97fbb4f816aca0fb2f94ccf3a2"; + commit = "918b281754d4c289a3567cca083774087b2a2ec0"; in pkgs.fetchPackwizModpack { - packHash = "sha256-X9CTYHfGRx6caCHfe+KS6/jhXV5fPCZ9hr8O2tlXus0="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From b8b5084352287158eb9011d9b6d9eb57d27e13f5 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 10 May 2026 18:54:43 +0700 Subject: [PATCH 32/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 182a82f..70c9dc0 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "918b281754d4c289a3567cca083774087b2a2ec0"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-HmTDQac9FCQXBPWiZIxu9zmHyl2vqMVQpZpDHp+2lBA="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 35185583ee71deb26f0bad0a45cbd25e8544ddff Mon Sep 17 00:00:00 2001 From: satr14 Date: Mon, 11 May 2026 16:12:48 +0700 Subject: [PATCH 33/58] fix battery notif --- modules/hardware/misc/battery-power.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/hardware/misc/battery-power.nix b/modules/hardware/misc/battery-power.nix index 3a2ca6b..8c529e1 100644 --- a/modules/hardware/misc/battery-power.nix +++ b/modules/hardware/misc/battery-power.nix @@ -17,8 +17,10 @@ BAT_PCT=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '[0-9]+(?=%)'` BAT_STA=`${pkgs.acpi}/bin/acpi -b | ${pkgs.gnugrep}/bin/grep -P -o '\w+(?=,)'` echo "`date` battery status:$BAT_STA percentage:$BAT_PCT" - test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send "Low Battery" "Battery remaining: $BAT_PCT%." - test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && DISPLAY=:0.0 ${pkgs.libnotify}/bin/notify-send -u critical "Low Battery" "Shutdown at 10%." + export DISPLAY=:0 + export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus + test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send "Low Battery" "Battery remaining: $BAT_PCT%." + test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send -u critical "Low Battery" "Shutdown at 10%." ''} > /tmp/cron.batt.log 2>&1" ]; }; From 23d4592783c0fc2991375912b8b1b890ddd7bf81 Mon Sep 17 00:00:00 2001 From: satr14 Date: Mon, 11 May 2026 16:26:43 +0700 Subject: [PATCH 34/58] cleanup flag config and update modpack --- modules/system/homelab/mc.nix | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 70c9dc0..d545f0b 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "918b281754d4c289a3567cca083774087b2a2ec0"; + commit = "506050af820a4cf370c6f2021c5991d665ba902a"; in pkgs.fetchPackwizModpack { - packHash = "sha256-HmTDQac9FCQXBPWiZIxu9zmHyl2vqMVQpZpDHp+2lBA="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; @@ -38,23 +38,17 @@ in { jvmOpts = let flags = [ "-Xms${toString ram-allocation-mb}M" "-Xmx${toString ram-allocation-mb}M" - - # Exposes SIMD instructions (requires full JDK, useful with performance mods) - "--add-modules=jdk.incubator.vector" - - # ZGC flags (requires Java v25+, 8+ CPU cores, 10GB+ RAM) - "-XX:+UseZGC" - "-XX:+UseLargePages" - "-XX:+AlwaysPreTouch" - "-XX:+DisableExplicitGC" - "-XX:+PerfDisableSharedMem" - "-XX:+UseCompactObjectHeaders" - "-XX:ZAllocationSpikeTolerance=5" - "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" - - # High MSPT due to ZGC pauses - "-XX:ZUncommitDelay=300" - "-XX:ZCollectionInterval=5" + + "-XX:+UseZGC" # Use ZGC (requires Java v25+, 8+ CPU cores, 10GB+ RAM) + "-XX:+UseCompactObjectHeaders" # Use compact object headers (requires Java v16+, saves a couple of bits per object) + + "--add-modules=jdk.incubator.vector" # Exposes SIMD instructions (requires full JDK, useful with performance mods) + "-XX:+UseLargePages" # Large pages support (requires hugepages configured on the system) + "-XX:+AlwaysPreTouch" # Pre-allocates memory on startup, OS claims it immediately for JVM instead of negotiating it + "-XX:+DisableExplicitGC" # Disables mods from manually invoking the GC + "-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics + "-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players (causes unnecessary GC load at idle) + "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom for off-heap memory (native code, mods, and ZGC overhead) ]; in lib.concatStringsSep " " flags; # extraStartPost = let gamerules = { From 33f323d1ec2ede8aeb11f98e9818a2a31ae55ea8 Mon Sep 17 00:00:00 2001 From: satr14 Date: Mon, 11 May 2026 16:39:50 +0700 Subject: [PATCH 35/58] cleanup config, use new dir, update hash --- modules/system/homelab/mc.nix | 87 +++++++++++++++-------------------- 1 file changed, 36 insertions(+), 51 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index d545f0b..cc44d20 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "506050af820a4cf370c6f2021c5991d665ba902a"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-Haonn1K74z0aREXCfb/t88DtYD6Kboq23kS6wxqKc3Y="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; @@ -21,14 +21,46 @@ in { services.minecraft-servers = { enable = true; eula = true; - managementSystem.systemd-socket.enable = true; # Referenced but unset environment variable evaluates to an empty string: MAINPID + managementSystem.systemd-socket.enable = true; # ^^^ https://github.com/Infinidoge/nix-minecraft/issues/119 + + # TODO: figure out how to set gamerules on start (script above runs **before** server ready) + # gamerules to disable: locator_bar, mob_explosion_drop_decay - servers.mc0-explorers-creativity = { + servers.da-s3 = { enable = true; autoStart = true; restart = "always"; - enableReload = true; # NOTE: development phase, disable in production + enableReload = false; + + serverProperties = { + server-port = 25565; + server-name = "Minecraft Server"; + motd = "§lSeason 3§r - §dExplorers Creativity 🔥"; + + difficulty = "normal"; + gamemode = "survival"; + max-world-size = 25000; + spawn-protection = 0; + pvp = true; + + online-mode = true; + enable-query = true; + enforce-secure-profile = false; + pevent-proxy-connections = false; + allow-flight = false; + player-idle-timeout = 0; + + view-distance = 12; + simulation-distance = 4; + + enable-rcon = true; + sync-chunk-writes = false; + "rcon.password" = rcon-pass; + "rcon.port" = 25575; + }; + + symlinks."mods" = "${modpack}/mods"; package = pkgs.fabricServers.fabric-1_21_11.override { jre_headless = pkgs.javaPackages.compiler.temurin-bin.jdk-25; @@ -50,53 +82,6 @@ in { "-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players (causes unnecessary GC load at idle) "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom for off-heap memory (native code, mods, and ZGC overhead) ]; 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: "${pkgs.rcon-cli}/bin/rcon-cli --password ${rcon-pass} gamerule ${rule} ${toString (gamerules.${rule})}") - # (lib.attrNames gamerules) - # ); - # TODO: figure out how to set gamerules on start (script above runs **before** server ready) - - serverProperties = { - server-port = 25565; - server-name = "Minecraft Server"; - motd = "§lSeason 3 TESTING§r - §dExplorers Creativity 🔥"; - - difficulty = "normal"; - gamemode = "survival"; - max-world-size = 25000; - spawn-protection = 0; - pvp = true; - - online-mode = true; - enable-query = true; - enforce-secure-profile = false; - pevent-proxy-connections = false; - allow-flight = false; - player-idle-timeout = 0; - - # resource-pack = "https://cdn.satr14.my.id/public/fullslide-1.21.11.zip"; - # resource-pack-sha1 = "e0958dcef5755286f390c22280700c471ec34a65"; - # resource-pack-enforce = false; - - view-distance = 12; - simulation-distance = 4; - - enable-rcon = true; - sync-chunk-writes = false; - "rcon.password" = rcon-pass; - "rcon.port" = 25575; - }; - - symlinks = { - # "server-icon.png" = "${modpack}/server-icon.png"; - "mods" = "${modpack}/mods"; - }; }; }; } \ No newline at end of file From 3ac6b06f434621f34edfae825e13768708595244 Mon Sep 17 00:00:00 2001 From: satr14 Date: Tue, 12 May 2026 21:28:06 +0700 Subject: [PATCH 36/58] fix luckperms error --- modules/system/homelab/mc.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index cc44d20..ece3dec 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -60,7 +60,9 @@ in { "rcon.port" = 25575; }; - symlinks."mods" = "${modpack}/mods"; + symlinks = lib.mapAttrs' + (name: _: lib.nameValuePair "mods/${name}" "${modpack}/mods/${name}") + (builtins.readDir "${modpack}/mods"); package = pkgs.fabricServers.fabric-1_21_11.override { jre_headless = pkgs.javaPackages.compiler.temurin-bin.jdk-25; From c2924a2a58d45cb6b22087944f2d9d363077cfeb Mon Sep 17 00:00:00 2001 From: satr14 Date: Wed, 13 May 2026 15:15:01 +0700 Subject: [PATCH 37/58] enable jstat --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index ece3dec..7c35d85 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -80,7 +80,7 @@ in { "-XX:+UseLargePages" # Large pages support (requires hugepages configured on the system) "-XX:+AlwaysPreTouch" # Pre-allocates memory on startup, OS claims it immediately for JVM instead of negotiating it "-XX:+DisableExplicitGC" # Disables mods from manually invoking the GC - "-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics + # "-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics "-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players (causes unnecessary GC load at idle) "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom for off-heap memory (native code, mods, and ZGC overhead) ]; in lib.concatStringsSep " " flags; From 7791a235909caf9a3670184872f25927ba1bfa38 Mon Sep 17 00:00:00 2001 From: satr14 Date: Wed, 13 May 2026 15:18:29 +0700 Subject: [PATCH 38/58] shorten journal output --- modules/home/core/shell.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/home/core/shell.nix b/modules/home/core/shell.nix index 2a23a42..7c69e47 100644 --- a/modules/home/core/shell.nix +++ b/modules/home/core/shell.nix @@ -37,9 +37,9 @@ "cd" = "z"; "sys" = "sudo systemctl --runtime"; - "sys-log" = "journalctl -f -b -u"; + "sys-log" = "journalctl -o cat -f -b -u"; "user" = "systemctl --user --runtime"; - "user-log" = "journalctl -f -b --user-unit"; + "user-log" = "journalctl -o cat -f -b --user-unit"; "ts" = "sudo tailscale"; "tsip" = "tailscale ip -4"; From d97d291c981753666b7925ba32c506f6aa2fe680 Mon Sep 17 00:00:00 2001 From: satr14 Date: Thu, 14 May 2026 09:08:05 +0700 Subject: [PATCH 39/58] set to perf overclock --- modules/system/homelab/mc.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 7c35d85..0834b82 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -12,7 +12,7 @@ in { imports = [ inputs.mc.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.mc.overlay ]; - powerManagement.cpuFreqGovernor = "schedutil"; + powerManagement.cpuFreqGovernor = "performance"; boot.kernel.sysctl = { "vm.nr_hugepages" = (ram-allocation-mb / 2) + 512; # (heap_mb / 2MB per page) + 512 pages (1GB) for ZGC off-heap overhead "vm.swappiness" = 10; @@ -83,6 +83,8 @@ in { # "-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics "-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players (causes unnecessary GC load at idle) "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom for off-heap memory (native code, mods, and ZGC overhead) + "-XX:ZCollectionInterval=1" # Force a GC cycle at minimum every 1s — prevents allocation stalls when ZGC falls behind Minecraft's bursty allocation + "-XX:ConcGCThreads=4" # Threads ZGC uses for concurrent work; default (cpu/8+1) is often just 2, too slow to keep up with allocation rate ]; in lib.concatStringsSep " " flags; }; }; From c3db68fad698a12efb507bbf5ef3189bcb15ef5c Mon Sep 17 00:00:00 2001 From: satr14 Date: Thu, 14 May 2026 09:21:54 +0700 Subject: [PATCH 40/58] try powersave --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 0834b82..8682e1d 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -12,7 +12,7 @@ in { imports = [ inputs.mc.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.mc.overlay ]; - powerManagement.cpuFreqGovernor = "performance"; + powerManagement.cpuFreqGovernor = "powersave"; boot.kernel.sysctl = { "vm.nr_hugepages" = (ram-allocation-mb / 2) + 512; # (heap_mb / 2MB per page) + 512 pages (1GB) for ZGC off-heap overhead "vm.swappiness" = 10; From 0ebe87c5c376ff4f0b6927611c79f227dbc57a1f Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 15 May 2026 21:01:29 +0700 Subject: [PATCH 41/58] update modpack --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 8682e1d..2362e61 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "506050af820a4cf370c6f2021c5991d665ba902a"; + commit = "c7d1a2d8d181104707dd549fc65fffda956b8f40"; in pkgs.fetchPackwizModpack { - packHash = "sha256-Haonn1K74z0aREXCfb/t88DtYD6Kboq23kS6wxqKc3Y="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 05b6c5f45074bdc262a6a5b6c9f0cb0e68c0a0d6 Mon Sep 17 00:00:00 2001 From: satr14 Date: Fri, 15 May 2026 21:02:56 +0700 Subject: [PATCH 42/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 2362e61..20b8b5f 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "c7d1a2d8d181104707dd549fc65fffda956b8f40"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-h/hQalxd8C5D5LADgsok3bMeQSb2Bgpg6UIbZWM0fw8="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 6a106d606c28cdffe6e0d82aed9f1b93a25776b9 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:23:54 +0700 Subject: [PATCH 43/58] add clipboard support --- modules/home/core/cli.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/home/core/cli.nix b/modules/home/core/cli.nix index 86b3c08..4f2dbf6 100644 --- a/modules/home/core/cli.nix +++ b/modules/home/core/cli.nix @@ -49,10 +49,20 @@ initLua = '' vim.opt.clipboard = "unnamedplus" vim.opt.termguicolors = true + vim.g.clipboard = { + name = "OSC 52", + copy = { + ["+"] = require("vim.ui.clipboard.osc52").copy("+"), + ["*"] = require("vim.ui.clipboard.osc52").copy("*"), + }, + paste = { + ["+"] = require("vim.ui.clipboard.osc52").paste("+"), + ["*"] = require("vim.ui.clipboard.osc52").paste("*"), + }, + } require("nvim-tree").setup() vim.api.nvim_create_autocmd("VimEnter", { callback = function() - -- vim.cmd("NvimTreeOpen") vim.cmd("set nu") vim.cmd.wincmd 'p' end, From 70fa5793315a4202dcf3fe2d4e794967d8cc0289 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:35:48 +0700 Subject: [PATCH 44/58] update modpack and add me as an op --- modules/system/homelab/mc.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 20b8b5f..be0d461 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "c7d1a2d8d181104707dd549fc65fffda956b8f40"; + commit = "81067d9cea4e3c48acceb42c8c62c252ab1bd3b2"; in pkgs.fetchPackwizModpack { - packHash = "sha256-h/hQalxd8C5D5LADgsok3bMeQSb2Bgpg6UIbZWM0fw8="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; @@ -33,6 +33,13 @@ in { restart = "always"; enableReload = false; + operators."satr14" = { + uuid = "54441a30-fe73-46e7-adca-c476bd4fc6d2"; + bypassesPlayerLimit = true; + level = 4; + }; + # ^^ DISABLE ON PROD + serverProperties = { server-port = 25565; server-name = "Minecraft Server"; From 9993ed52a750e83df48070c918ea4e74dcbce83e Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:36:43 +0700 Subject: [PATCH 45/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index be0d461..2c85010 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "81067d9cea4e3c48acceb42c8c62c252ab1bd3b2"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-D34uF8LUPNM1LTvOM3V8tvo4yfG++UODxW2qH2tXs/8="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From df27e80f4a0d51202150f8ab6afe550986492da7 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:37:57 +0700 Subject: [PATCH 46/58] [skip ci] small note --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 2c85010..ca92440 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -12,7 +12,7 @@ in { imports = [ inputs.mc.nixosModules.minecraft-servers ]; nixpkgs.overlays = [ inputs.mc.overlay ]; - powerManagement.cpuFreqGovernor = "powersave"; + powerManagement.cpuFreqGovernor = "powersave"; # performance governor causes overheating and thermal throttling, works fine with powesave boot.kernel.sysctl = { "vm.nr_hugepages" = (ram-allocation-mb / 2) + 512; # (heap_mb / 2MB per page) + 512 pages (1GB) for ZGC off-heap overhead "vm.swappiness" = 10; From 858e77735fe3cdf1cec7543212f2dd94914c30be Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:51:20 +0700 Subject: [PATCH 47/58] [skip ci] add extra notes --- modules/system/homelab/mc.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index ca92440..6a0cdf3 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -26,6 +26,7 @@ in { # TODO: figure out how to set gamerules on start (script above runs **before** server ready) # gamerules to disable: locator_bar, mob_explosion_drop_decay + # gamerules to enable (temporarily): noend:disable_end servers.da-s3 = { enable = true; From 3db7568fa65f527a0e2264b9cb47e2b92f426e5f Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:51:48 +0700 Subject: [PATCH 48/58] [skip ci] fix comment --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 6a0cdf3..944ea4a 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -24,7 +24,7 @@ in { managementSystem.systemd-socket.enable = true; # ^^^ https://github.com/Infinidoge/nix-minecraft/issues/119 - # TODO: figure out how to set gamerules on start (script above runs **before** server ready) + # TODO: figure out how to set gamerules on start # gamerules to disable: locator_bar, mob_explosion_drop_decay # gamerules to enable (temporarily): noend:disable_end From 180521963ab5ed0dc27d6ecd1ffb37393e05f00e Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:53:54 +0700 Subject: [PATCH 49/58] [skip ci] todo comments --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 944ea4a..0baf6cc 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -25,7 +25,7 @@ in { # ^^^ https://github.com/Infinidoge/nix-minecraft/issues/119 # TODO: figure out how to set gamerules on start - # gamerules to disable: locator_bar, mob_explosion_drop_decay + # gamerules to disable: locator_bar, mob_explosion_drop_decay, (and possibly) reduced_debug_info, global_sound_events # gamerules to enable (temporarily): noend:disable_end servers.da-s3 = { From 287458eec01d0e12beec8d386959a051d59be691 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 07:59:29 +0700 Subject: [PATCH 50/58] disable ip logging --- modules/system/homelab/mc.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 0baf6cc..f63a1fb 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -42,9 +42,11 @@ in { # ^^ DISABLE ON PROD serverProperties = { + # server-ip = "localhost"; server-port = 25565; server-name = "Minecraft Server"; motd = "§lSeason 3§r - §dExplorers Creativity 🔥"; + log-ips = false; # TODO: figure out how to get ips from cloudflared tunnel difficulty = "normal"; gamemode = "survival"; From 092883606a36dca791e9a69582dc40ec3659a562 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 08:57:32 +0700 Subject: [PATCH 51/58] switch dashboard to be main page --- modules/system/homelab/dash.nix | 190 ++++++++++++++++---------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/modules/system/homelab/dash.nix b/modules/system/homelab/dash.nix index d973699..e7d62bf 100644 --- a/modules/system/homelab/dash.nix +++ b/modules/system/homelab/dash.nix @@ -89,6 +89,101 @@ in { }; pages = [ + { + name = "Dashboard"; + show-mobile-header = true; + width = "slim"; + columns = [ + { + size = "small"; + widgets = [ + { + type = "monitor"; + title = "Critical Systems"; + cache = "15s"; + style = "compact"; + show-failing-only = true; + sites = map (e: { + same-tab = true; + allow-insecure = true; + title = builtins.elemAt e 0; + url = builtins.elemAt e 1; + }) monitor; + } + { + type = "dns-stats"; + title = "DNS Stats"; + service = "adguard"; + url = "http://localhost:8088/"; + hour-format = "12h"; + } + { + type = "bookmarks"; + groups = [ + { + links = [{ + same-tab = true; + title = "NixFlake"; + icon = "si:nixos"; + url = "https://flake.satr14.my.id"; + }]; + } + { + links = map (e: { + same-tab = true; + title = builtins.elemAt e 0; + icon = "si:${builtins.elemAt e 1}"; + url = builtins.elemAt e 2; + alt-status-codes = [ 401 ]; + }) bookmarks; + } + ]; + } + { + type = "to-do"; + id = "tasks"; + } + ]; + } + { + size = "full"; + widgets = [ + { + type = "server-stats"; + servers = [{ + type = "local"; + mountpoints = { + "/boot".hide = true; + "/nix/store".hide = true; + "/var/lib/vaultwarden".hide = true; + "/var/lib/private/cryptpad".hide = true; + "/var/lib/acme/proxy.satr14.my.id".hide = true; + }; + }]; + } + { + type = "monitor"; + cache = "1m"; + title = "Services"; + sites = map (e: { + same-tab = true; + allow-insecure = true; + title = builtins.elemAt e 0; + icon = "si:${builtins.elemAt e 1}"; + url = builtins.elemAt e 2; + check-url = builtins.elemAt e 3; + }) homelab.dash; + } + { + type = "docker-containers"; + title = "Containers"; + format-container-names = true; + hide-by-default = true; + } + ]; + } + ]; + } { name = "Home"; show-mobile-header = true; @@ -187,101 +282,6 @@ in { } ]; } - { - name = "Dashboard"; - show-mobile-header = true; - width = "slim"; - columns = [ - { - size = "small"; - widgets = [ - { - type = "monitor"; - title = "Critical Systems"; - cache = "15s"; - style = "compact"; - show-failing-only = true; - sites = map (e: { - same-tab = true; - allow-insecure = true; - title = builtins.elemAt e 0; - url = builtins.elemAt e 1; - }) monitor; - } - { - type = "dns-stats"; - title = "DNS Stats"; - service = "adguard"; - url = "http://localhost:8088/"; - hour-format = "12h"; - } - { - type = "bookmarks"; - groups = [ - { - links = [{ - same-tab = true; - title = "NixFlake"; - icon = "si:nixos"; - url = "https://flake.satr14.my.id"; - }]; - } - { - links = map (e: { - same-tab = true; - title = builtins.elemAt e 0; - icon = "si:${builtins.elemAt e 1}"; - url = builtins.elemAt e 2; - alt-status-codes = [ 401 ]; - }) bookmarks; - } - ]; - } - { - type = "to-do"; - id = "tasks"; - } - ]; - } - { - size = "full"; - widgets = [ - { - type = "server-stats"; - servers = [{ - type = "local"; - mountpoints = { - "/boot".hide = true; - "/nix/store".hide = true; - "/var/lib/vaultwarden".hide = true; - "/var/lib/private/cryptpad".hide = true; - "/var/lib/acme/proxy.satr14.my.id".hide = true; - }; - }]; - } - { - type = "monitor"; - cache = "1m"; - title = "Services"; - sites = map (e: { - same-tab = true; - allow-insecure = true; - title = builtins.elemAt e 0; - icon = "si:${builtins.elemAt e 1}"; - url = builtins.elemAt e 2; - check-url = builtins.elemAt e 3; - }) homelab.dash; - } - { - type = "docker-containers"; - title = "Containers"; - format-container-names = true; - hide-by-default = true; - } - ]; - } - ]; - } ]; }; }; From b349172b599782b41da2fc54961d2794511d2319 Mon Sep 17 00:00:00 2001 From: satr14 Date: Sun, 17 May 2026 13:11:18 +0700 Subject: [PATCH 52/58] jvm tuning --- modules/system/homelab/mc.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index f63a1fb..3923e3a 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -90,11 +90,11 @@ in { "-XX:+UseLargePages" # Large pages support (requires hugepages configured on the system) "-XX:+AlwaysPreTouch" # Pre-allocates memory on startup, OS claims it immediately for JVM instead of negotiating it "-XX:+DisableExplicitGC" # Disables mods from manually invoking the GC - # "-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics - "-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players (causes unnecessary GC load at idle) - "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom for off-heap memory (native code, mods, and ZGC overhead) - "-XX:ZCollectionInterval=1" # Force a GC cycle at minimum every 1s — prevents allocation stalls when ZGC falls behind Minecraft's bursty allocation - "-XX:ConcGCThreads=4" # Threads ZGC uses for concurrent work; default (cpu/8+1) is often just 2, too slow to keep up with allocation rate + "-XX:+PerfDisableSharedMem" # Disables constant /tmp writes for JVM metrics + "-XX:ZAllocationSpikeTolerance=5" # Helps when server is active with many players + "-XX:SoftMaxHeapSize=${toString (ram-allocation-mb - 2048)}M" # Leave 2GB headroom + "-XX:ZCollectionInterval=1" # Force a GC cycle at minimum every second + "-XX:ConcGCThreads=8" # Threads ZGC uses for concurrent work ]; in lib.concatStringsSep " " flags; }; }; From 79fd698e12845f87c0231fcd2d00b057d686c61f Mon Sep 17 00:00:00 2001 From: satr14 Date: Tue, 19 May 2026 17:28:15 +0700 Subject: [PATCH 53/58] update modpack --- modules/system/homelab/mc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 3923e3a..cf6b40c 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -2,9 +2,9 @@ ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let - commit = "81067d9cea4e3c48acceb42c8c62c252ab1bd3b2"; + commit = "8523f89493ace13087eb68cd9fe3b5eb4f669440"; in pkgs.fetchPackwizModpack { - packHash = "sha256-D34uF8LUPNM1LTvOM3V8tvo4yfG++UODxW2qH2tXs/8="; + packHash = ""; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 8745a66a2a00828c358a3899f9247751dd8a0c4b Mon Sep 17 00:00:00 2001 From: satr14 Date: Tue, 19 May 2026 17:37:50 +0700 Subject: [PATCH 54/58] update hash --- modules/system/homelab/mc.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index cf6b40c..2084d2e 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -4,7 +4,7 @@ modpack = let commit = "8523f89493ace13087eb68cd9fe3b5eb4f669440"; in pkgs.fetchPackwizModpack { - packHash = ""; + packHash = "sha256-xB9Oc/aneogSQ9r7L42vyVM6xwq+QkoTaXYNuUzeo6M="; url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; }; From 89931de313b72ff38235ea8f82d261cf11cf5a5c Mon Sep 17 00:00:00 2001 From: satr14 Date: Sat, 30 May 2026 18:29:01 +0700 Subject: [PATCH 55/58] enable netbird --- modules/system/server.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/system/server.nix b/modules/system/server.nix index 57a3ff0..a2cef9f 100644 --- a/modules/system/server.nix +++ b/modules/system/server.nix @@ -35,14 +35,17 @@ in { users.users.root.openssh.authorizedKeys.keys = homelab.ssh-keys; - services.tailscale = { - enable = true; - authKeyFile = "/mnt/data/apps/tailscale/authkey"; - useRoutingFeatures = "server"; - extraUpFlags = ts-flags; - extraSetFlags = ts-flags; + services = { + netbird.enable = true; + tailscale = { + enable = true; + authKeyFile = "/mnt/data/apps/tailscale/authkey"; + useRoutingFeatures = "server"; + extraUpFlags = ts-flags; + extraSetFlags = ts-flags; + }; }; - + virtualisation = { oci-containers.backend = "docker"; docker = { From dced4e3a58e48f5387d0deebb3321b919f3211d8 Mon Sep 17 00:00:00 2001 From: satr14 Date: Thu, 4 Jun 2026 13:51:24 +0700 Subject: [PATCH 56/58] add bun --- modules/system/homelab/git.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/homelab/git.nix b/modules/system/homelab/git.nix index db30c7a..2544f90 100644 --- a/modules/system/homelab/git.nix +++ b/modules/system/homelab/git.nix @@ -45,7 +45,7 @@ url = "http://localhost:5080"; #"https://git.proxy.${homelab.domain}"; tokenFile = "/mnt/data/apps/forgejo/token-runner"; labels = [ "self-hosted:host" ]; - hostPackages = with pkgs; [ bash coreutils git nix openssh nodejs ]; + hostPackages = with pkgs; [ bash coreutils git nix openssh bun ]; }; }; systemd.services = { From cabd26d2323b6b8a733a11c4d89ef06324cc9d4a Mon Sep 17 00:00:00 2001 From: satr14 Date: Thu, 4 Jun 2026 13:51:57 +0700 Subject: [PATCH 57/58] prod toggle --- modules/system/homelab/mc.nix | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/system/homelab/mc.nix b/modules/system/homelab/mc.nix index 2084d2e..90e2e76 100644 --- a/modules/system/homelab/mc.nix +++ b/modules/system/homelab/mc.nix @@ -1,11 +1,13 @@ { inputs, lib, pkgs, ... }: let + production = true; ram-allocation-mb = 12288; rcon-pass = "howdy"; modpack = let commit = "8523f89493ace13087eb68cd9fe3b5eb4f669440"; + path = if production then "commit/${commit}" else "branch/main"; in pkgs.fetchPackwizModpack { packHash = "sha256-xB9Oc/aneogSQ9r7L42vyVM6xwq+QkoTaXYNuUzeo6M="; - url = "https://git.satr14.my.id/satr14/server-modpack/raw/commit/${commit}/pack.toml"; + url = "https://git.satr14.my.id/satr14/server-modpack/raw/${path}/pack.toml"; }; in { @@ -32,14 +34,25 @@ in { enable = true; autoStart = true; restart = "always"; - enableReload = false; + enableReload = production; + # extraReload = '' + # function rcon() { + # ${pkgs.rcon-cli}/bin/rcon-cli -p ${rcon-pass} $@ + # } + + # rcon "gamerule locator_bar false" + # rcon "gamerule mob_explosion_drop_decay false" + # rcon "gamerule reduced_debug_info false" + # rcon "gamerule global_sound_events false" + # ''; - operators."satr14" = { - uuid = "54441a30-fe73-46e7-adca-c476bd4fc6d2"; - bypassesPlayerLimit = true; - level = 4; + operators = lib.mkIf (!production) { + "satr14" = { + uuid = "54441a30-fe73-46e7-adca-c476bd4fc6d2"; + bypassesPlayerLimit = true; + level = 4; + }; }; - # ^^ DISABLE ON PROD serverProperties = { # server-ip = "localhost"; From 598737859c3473fb72e52a303ba72a0438e3ff0b Mon Sep 17 00:00:00 2001 From: satr14 Date: Thu, 4 Jun 2026 13:52:20 +0700 Subject: [PATCH 58/58] todo --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 9172fc5..f8496c7 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,11 @@ - `thinkpad` - Thinkpad T480, i5 8350U, 16GB RAM, 256GB NVME - `homelab` - i7 8700T, 32GB RAM, 512GB NVME, 1TB 2.5" SATA +## Todo +- Automatic backups to external drives. +- Better documentation and code structure. +- Use NixOS modules system. + ## Credits - [orangc's flake](https://git.orangc.net/c/dots) - [vimjoyer's tutorials](https://www.youtube.com/@vimjoyer)