summary refs log tree commit diff stats
path: root/system/services/minecraft/default.nix
blob: 9bc98b9bd945329532132fc761a196f2c0a48d68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{lib, ...}: {
  vhack.persist.directories = [
    {
      directory = "/var/lib/minecraft";
      user = "minecraft";
      group = "minecraft";
      mode = "0700";
    }
  ];

  nixpkgs.config.allowUnfreePredicate = pkg:
    builtins.elem (lib.getName pkg) [
      "minecraft-server"
    ];
  services.minecraft-server = {
    enable = true;
    declarative = true;
    eula = true;
    dataDir = "/var/lib/minecraft";
    openFirewall = true;
    jvmOpts = "-Xmx8192M -Xms8192M";
    whitelist = {
      ShadyCraft = "7995eea5-b648-41c4-9b0f-7fc082565952";
      Nightingale768 = "1125d077-6709-44b2-9be0-587aec772e7a";
      Sirius_Black123 = "f5f66fc5-f287-434e-a03f-2480f998e76f";
      DerDaHalt = "09c72cb7-cab9-444f-af55-616fcf93822c";
    };
    serverProperties = {
      player-idle-timeout = 30;
      white-list = true;
      difficulty = 3;
      gamemode = "survival";
      enforce-whitelist = true;
      simulation-distance = 10;
    };
  };
}