mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add statech
This commit is contained in:
parent
65d4e2cc48
commit
c7c99f8ba6
8 changed files with 135 additions and 74 deletions
|
|
@ -21,7 +21,6 @@ in with lib; {
|
|||
"zoxide"
|
||||
"dircolors"
|
||||
"nix-index"
|
||||
"thefuck"
|
||||
|
||||
"lazygit"
|
||||
"fd"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
};
|
||||
};
|
||||
|
||||
imports = [ ./astral.nix ./vrising.nix ];
|
||||
imports = [ ./astral.nix ./vrising.nix ./statech.nix ];
|
||||
|
||||
config = lib.mkIf config.mods.server.gaming.enable {
|
||||
mods.server.astral.enable = true;
|
||||
|
|
|
|||
59
modules/nixos/server/gaming/statech.nix
Normal file
59
modules/nixos/server/gaming/statech.nix
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{ 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));
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue