Migrate mc server to nix-minecraft flake
This commit is contained in:
parent
f06979ac1d
commit
92f1c6f3fa
6 changed files with 114 additions and 41 deletions
|
|
@ -1,19 +1,33 @@
|
|||
{ inputs, config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
services.minecraft-server = {
|
||||
let
|
||||
modpack = pkgs.fetchPackwizModpack {
|
||||
url =
|
||||
"https://raw.githubusercontent.com/baduhai/FFS/06d253f0cd262b8d4a178d4db8e1a7188051e8d0/pack.toml";
|
||||
packHash = "sha256-";
|
||||
};
|
||||
mcVersion = modpack.manifest.versions.minecraft;
|
||||
fabricVersion = modpack.manifest.versions.fabric;
|
||||
serverVersion =
|
||||
lib.replaceStrings [ "." ] [ "_" ] "fabric-${mcVersion}-${fabricVersion}";
|
||||
|
||||
in {
|
||||
services.minecraft-servers = {
|
||||
enable = true;
|
||||
eula = true;
|
||||
declarative = true;
|
||||
openFirewall = true;
|
||||
package = pkgs.papermc;
|
||||
serverProperties = {
|
||||
motd = "Bem-vindo a Alexandria";
|
||||
difficulty = "hard";
|
||||
gamemode = "survival";
|
||||
online-mode = "false";
|
||||
spawn-protection = "0";
|
||||
};
|
||||
dataDir = "/data/minecraft";
|
||||
servers."alexandria" = {
|
||||
enable = true;
|
||||
package = pkgs.fabricServers.${serverVersion};
|
||||
openFirewall = true;
|
||||
serverProperties = {
|
||||
difficulty = "hard";
|
||||
gamemode = "survival";
|
||||
motd = "O Seridor";
|
||||
online-mode = false;
|
||||
spawn-protection = false;
|
||||
};
|
||||
symlink."mods" = "${modpack}/mods";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue