mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 16:17:46 +00:00
59 lines
2.1 KiB
Nix
59 lines
2.1 KiB
Nix
{ pkgs, lib, config, inputs, sources, ... }:
|
|
let
|
|
inherit (inputs.nix-minecraft.lib) collectFilesAt;
|
|
modpack = pkgs.fetchPackwizModpack {
|
|
# version = "main";
|
|
url = "https://github.com/nix-astral/statech/raw/modrinth/pack.toml";
|
|
packHash = "sha256-osXcGvsoaTgu7z4eamDL/wiDewM+rge4gdu54I7wxXc=";
|
|
manifestHash =
|
|
"sha256:081s5qzx3v1cpb8a8ns77z3hqcd7df52b55cr0xmqr2ziir8ml07";
|
|
};
|
|
mcVersion = modpack.manifest.versions.minecraft;
|
|
fabricVersion = modpack.manifest.versions.fabric;
|
|
serverVersion = lib.replaceStrings [ "." ] [ "_" ] "fabric-${mcVersion}";
|
|
in {
|
|
options.mods.server.statech = {
|
|
enable = lib.mkEnableOption {
|
|
default = false;
|
|
description = "enables minecraft statech server";
|
|
};
|
|
memory = lib.mkOption {
|
|
default = "6G";
|
|
description = "server detitated wam";
|
|
};
|
|
autoStart = lib.mkEnableOption {
|
|
default = true;
|
|
description = "start server on boot";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf config.mods.server.statech.enable {
|
|
services.minecraft-servers.servers.statech = {
|
|
enable = true;
|
|
serverProperties = { online-mode = true; };
|
|
autoStart = config.mods.server.statech.autoStart;
|
|
jvmOpts = (import ./aikar-flags.nix) config.mods.server.statech.memory;
|
|
package = pkgs.fabricServers.${serverVersion}.override {
|
|
loaderVersion = fabricVersion;
|
|
};
|
|
symlinks = {
|
|
# "global_packs" = "${modpack}/global_packs";
|
|
"kubejs" = "${modpack}/kubejs";
|
|
"config" = "${modpack}/config";
|
|
"mods" = "${modpack}/mods";
|
|
"resourcepacks" = "${modpack}/resourcepacks";
|
|
};
|
|
# symlinks =
|
|
# # collectFilesAt modpack "global_packs" //
|
|
# collectFilesAt modpack "kubejs" // collectFilesAt modpack "config"
|
|
# // collectFilesAt modpack "resourcepacks"
|
|
# // collectFilesAt modpack "mods" // {
|
|
|
|
# } // (lib.attrsets.mapAttrs' (n: v:
|
|
# lib.attrsets.nameValuePair
|
|
# ("mods/" + lib.strings.removePrefix "statech." n) v.src)
|
|
# (lib.attrsets.filterAttrs (n: v: lib.strings.hasPrefix "statech." n)
|
|
# sources));
|
|
};
|
|
};
|
|
}
|