From a5038dc4c004cb07552c9264553b469153937eb9 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Thu, 14 Dec 2023 14:46:37 +0100 Subject: [PATCH] set up modfest-build mc server --- flake.lock | 66 +++++++++---------- .../lucent-firepit/minecraft/aikar-flags.nix | 1 + hosts/lucent-firepit/minecraft/default.nix | 38 +++++++++++ 3 files changed, 72 insertions(+), 33 deletions(-) create mode 100644 hosts/lucent-firepit/minecraft/aikar-flags.nix diff --git a/flake.lock b/flake.lock index 3dd3624..edc6ac2 100755 --- a/flake.lock +++ b/flake.lock @@ -68,11 +68,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1702002149, - "narHash": "sha256-KAtAAnpfogr6XzdskJ33ytdrd0c6UU4OT94u84eWvpQ=", + "lastModified": 1702399955, + "narHash": "sha256-FnB5O1RVFzj3h7Ayf7UxFnOL1gsJuG6gn1LCTd9dKFs=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "170e86030361a09053abe3ca36b0fefa1292a13e", + "rev": "47798c4ab07d5f055bb2625010cf6d8e3f384923", "type": "github" }, "original": { @@ -195,11 +195,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1700814205, - "narHash": "sha256-lWqDPKHRbQfi+zNIivf031BUeyciVOtwCwTjyrhDB5g=", + "lastModified": 1702195709, + "narHash": "sha256-+zRjWkm5rKqQ57PuLZ3JF3xi3vPMiOJzItb1m/43Cq4=", "owner": "nix-community", "repo": "home-manager", - "rev": "aeb2232d7a32530d3448318790534d196bf9427a", + "rev": "6761b8188b860f374b457eddfdb05c82eef9752f", "type": "github" }, "original": { @@ -218,11 +218,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1701988578, - "narHash": "sha256-44jQ4XMNP5ql3fdXLN+SCEnKfZcK1aY34koIwFLWgYw=", + "lastModified": 1702488319, + "narHash": "sha256-goxBCjjWitvx2Oq4AihpA2OhYEirolMLC48fdA7Iey8=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "6fb1b89b982eea26ecae75b93f1742537c4f31ae", + "rev": "01e5c59d752d3fe7fa484330fa48e010054b8fa1", "type": "github" }, "original": { @@ -299,11 +299,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1701998456, - "narHash": "sha256-I/5XgTPo0tMmk0o/IZuml7Dx1uVT4oMHLUPIgFE4Sg0=", + "lastModified": 1702430423, + "narHash": "sha256-jJ2ZisjJ8ubQlBJcK9xTu2vqoqUtMw9OcxIhxmNz1BA=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "2ac70284dc5835f375f4f63ea763ede4e46d0dce", + "rev": "1af073ceea9c77a475fe6bac682b6d14646234fe", "type": "github" }, "original": { @@ -314,11 +314,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1701656485, - "narHash": "sha256-xDFormrGCKKGqngHa2Bz1GTeKlFMMjLnHhTDRdMJ1hs=", + "lastModified": 1702453208, + "narHash": "sha256-0wRi9SposfE2wHqjuKt8WO2izKB/ASDOV91URunIqgo=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "fa194fc484fd7270ab324bb985593f71102e84d1", + "rev": "7763c6fd1f299cb9361ff2abf755ed9619ef01d6", "type": "github" }, "original": { @@ -345,11 +345,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1701615100, - "narHash": "sha256-7VI84NGBvlCTduw2aHLVB62NvCiZUlALLqBe5v684Aw=", + "lastModified": 1702221085, + "narHash": "sha256-Br3GCSkkvkmw46cT6wCz6ro2H1WgDMWbKE0qctbdtL0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e9f06adb793d1cca5384907b3b8a4071d5d7cb19", + "rev": "c2786e7084cbad90b4f9472d5b5e35ecb57958af", "type": "github" }, "original": { @@ -361,11 +361,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1701718080, - "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", "type": "github" }, "original": { @@ -406,11 +406,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1701718080, - "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=", + "lastModified": 1702151865, + "narHash": "sha256-9VAt19t6yQa7pHZLDbil/QctAgVsA66DLnzdRGqDisg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335", + "rev": "666fc80e7b2afb570462423cb0e1cf1a3a34fedd", "type": "github" }, "original": { @@ -438,11 +438,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1700612854, - "narHash": "sha256-yrQ8osMD+vDLGFX7pcwsY/Qr5PUd6OmDMYJZzZi0+zc=", + "lastModified": 1702312524, + "narHash": "sha256-gkZJRDBUCpTPBvQk25G0B7vfbpEYM5s5OZqghkjZsnE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "19cbff58383a4ae384dea4d1d0c823d72b49d614", + "rev": "a9bf124c46ef298113270b1f84a164865987a91c", "type": "github" }, "original": { @@ -502,11 +502,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1701952659, - "narHash": "sha256-TJv2srXt6fYPUjxgLAL0cy4nuf1OZD4KuA1TrCiQqg0=", + "lastModified": 1702346276, + "narHash": "sha256-eAQgwIWApFQ40ipeOjVSoK4TEHVd6nbSd9fApiHIw5A=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b4372c4924d9182034066c823df76d6eaf1f4ec4", + "rev": "cf28ee258fd5f9a52de6b9865cdb93a1f96d09b7", "type": "github" }, "original": { @@ -660,11 +660,11 @@ ] }, "locked": { - "lastModified": 1700508250, - "narHash": "sha256-X4o/mifI7Nhu0UKYlxx53wIC+gYDo3pVM9L2u3PE2bE=", + "lastModified": 1702334919, + "narHash": "sha256-ibOZ3TLjqndGMcj2f+07NFwDWoum4IbzF58byZuJJNg=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "eb120ff25265ecacd0fc13d7dab12131b60d0f47", + "rev": "f5c3576c3b6cb1c31a8dfa3e4113f59bfe40cd71", "type": "github" }, "original": { diff --git a/hosts/lucent-firepit/minecraft/aikar-flags.nix b/hosts/lucent-firepit/minecraft/aikar-flags.nix new file mode 100644 index 0000000..a3d58a4 --- /dev/null +++ b/hosts/lucent-firepit/minecraft/aikar-flags.nix @@ -0,0 +1 @@ +memory: "-Xms${memory} -Xmx${memory} -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1" diff --git a/hosts/lucent-firepit/minecraft/default.nix b/hosts/lucent-firepit/minecraft/default.nix index 47be099..9aa842c 100644 --- a/hosts/lucent-firepit/minecraft/default.nix +++ b/hosts/lucent-firepit/minecraft/default.nix @@ -89,6 +89,44 @@ in { ''; }; }; + + "modfest-build" = let + modpack = (pkgs.fetchPackwizModpack rec { + url = "https://raw.githubusercontent.com/ModFest/modfest-skyandsea/main/pack/pack.toml"; + packHash = "sha256-I+Pqs3q4lI7Qzuot/9RejZhDgaltBxqMfwWsNfLkEVQ="; + manifestHash = "sha256:0w4b3y95s0jqhjfbzagbilw6fv6zlgzbqnl15kmsgcgb7kxzrzyy"; + }); + + mcVersion = "${modpack.manifest.versions.minecraft}"; + serverVersion = lib.replaceStrings [ "." ] [ "_" ] "fabric-${mcVersion}-0_15_1"; + in { + enable = true; + package = pkgs.fabricServers.${serverVersion}; + jvmOpts = (import ./aikar-flags.nix) "4G"; + + openFirewall = true; + + serverProperties = { + server-port = 25525; + gamemode = 1; + motd = "test server ignore"; + white-list = true; + max-players = 128; + allow-flight = true; + enable-command-block = true; + enforce-secure-profile = false; + snooper-enabled = false; + spawn-protection = 0; + }; + + whitelist = { + oatmealine = "241d7103-4c9d-4c45-9464-83b5365ce48e"; + }; + + symlinks = { + "mods" = "${modpack}/mods"; + }; + }; }; systemd.services.minecraft-server-dark-firepit.serviceConfig = {