2024-07-30 15:06:34 +01:00
|
|
|
{ config, pkgs, ... }:
|
2024-07-27 07:06:52 +01:00
|
|
|
{
|
2024-07-28 10:53:42 +01:00
|
|
|
nixpkgs.overlays = [
|
|
|
|
# Fetch papermc v1.21 from unstable branch of nixpkgs
|
2024-07-30 15:06:34 +01:00
|
|
|
(
|
|
|
|
final: prev:
|
|
|
|
let
|
|
|
|
pinnedPkgs = import (builtins.fetchTarball {
|
|
|
|
url = "https://github.com/NixOS/nixpkgs/archive/03a94c776f261b78b95de0971a94dea0199b4cd8.tar.gz";
|
|
|
|
sha256 = "0vngf4g468qd5fqch85nzyvn7bpa6p2i6rdmzc6ws2653x868w3g";
|
|
|
|
}) { inherit (pkgs) system; };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit (pinnedPkgs) papermc papermcServers;
|
|
|
|
}
|
|
|
|
)
|
2024-07-28 10:53:42 +01:00
|
|
|
];
|
2024-02-09 14:08:42 +00:00
|
|
|
services.minecraft-server = {
|
|
|
|
enable = true;
|
2024-07-28 10:53:42 +01:00
|
|
|
package = pkgs.papermcServers.papermc-1_21;
|
2024-02-09 14:08:42 +00:00
|
|
|
eula = true;
|
2024-03-10 08:07:05 +00:00
|
|
|
openFirewall = true;
|
2024-02-09 14:08:42 +00:00
|
|
|
declarative = true;
|
2024-07-27 07:06:52 +01:00
|
|
|
jvmOpts = "-Xmx4G -Xms4G";
|
2024-02-09 14:08:42 +00:00
|
|
|
whitelist = {
|
2024-03-10 08:07:05 +00:00
|
|
|
"pixelifytica" = "b1848d60-4ddd-4fa4-a328-fb269910b6ae";
|
2024-02-11 22:46:06 +00:00
|
|
|
"HomeInTheClouds" = "d49f0aee-f217-477b-9516-9d5906f7fc87";
|
2024-02-09 14:08:42 +00:00
|
|
|
};
|
|
|
|
serverProperties = {
|
2024-03-10 08:07:05 +00:00
|
|
|
server-port = 25565;
|
2024-02-11 22:46:06 +00:00
|
|
|
difficulty = "easy";
|
2024-02-09 14:08:42 +00:00
|
|
|
gamemode = "survival";
|
|
|
|
force-gamemode = true;
|
|
|
|
max-players = 10;
|
|
|
|
# level-seed = 238902389203;
|
|
|
|
motd = "NixOS Minecraft server!";
|
|
|
|
white-list = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|