about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/games/minecraft/minecraft-server-hibernation/default.nix
blob: 3837b890632bdf9815a0f809d11ce51013420ecc (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, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "minecraft-server-hibernation";
  version = "2.5.0";

  src = fetchFromGitHub {
    owner = "gekware";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-b6LeqjIraIasHBpaVgy8esl4NV8rdBrfO7ewgeIocS8=";
  };

  vendorHash = null;

  ldflags = [ "-s" "-w" ];

  checkFlags =
    let
      skippedTests = [
        # Disable tests requiring network access
        "Test_getPing"
        "Test_getReqType"
        "Test_QueryBasic"
        "Test_QueryFull"
      ];
    in
    [ "-skip" "${builtins.concatStringsSep "|" skippedTests}" ];

  meta = with lib; {
    description = "Autostart and stop minecraft-server when players join/leave";
    mainProgram = "msh";
    homepage = "https://github.com/gekware/minecraft-server-hibernation";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ squarepear ];
  };
}