aboutsummaryrefslogtreecommitdiff
path: root/wapkgs.nix
blob: a863a1c17e8b48c7086f77fad9846b2d0a60db08 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{pkgs ? import <nixpkgs> {}, ...}:

let
  patchSources = src: patches: pkgs.stdenv.mkDerivation {
    name = "${src.name}-patched";
    inherit patches src;
    buildPhase = "mkdir -p $out";
    installPhase = "cp -r * $out";
  };
  sources = {
    tcm = pkgs.fetchFromGitHub {
      owner = "thecodingmachine";
      repo = "workadventure";
      rev = "fb6a529e4ace614c04a41ae794d6087f0ad93d6b";
      sha256 = "10icfzffc7abl6k9lry2nidv75l3lx2f3djpw5mak9ayi05fl5xq";
    };
    xce = pkgs.fetchFromGitHub {
      owner = "workadventure-xce";
      repo = "workadventure-xce";
      rev = "54b3b611554b256abca77fc515a47cfbe4b02df6";
      sha256 = "0ia7054z9jmga7vyh2rzpxl7ssabrzhm9v06d7bhar1vqfbpcx9q";
    };
    xce-unfederated = pkgs.fetchFromGitHub {
      owner = "workadventure-xce";
      repo = "workadventure-xce";
      rev = "f0c26041f814a6c78679f1cdf555c0c4af87d8a3";
      sha256 = "13b4sd49yp9pyqpmlsh7w2sbns0nc9k13l5z94kbj8bcaslnwjx4";
    };
  };
  wapkgs =
    pkgs.lib.fix (self: let
      mkWorkadventureSet = waSelf: workadventuresrc: name:
        let
          callWaPackage = path: pkgs.lib.callPackageWith
             # some parts of workadventure depend on other parts of workadventure
            (self // { workadventure = waSelf;})
            (import path workadventuresrc name);
        in
          {
            back = callWaPackage ./back {};
            pusher = callWaPackage ./pusher {};
            messages = callWaPackage ./messages {};
            front = callWaPackage ./front {};
            uploader = callWaPackage ./uploader {};
            maps = callWaPackage ./maps {};
          };
    in pkgs // rec {
      tcm = mkWorkadventureSet tcm sources.tcm "tcm";
      xce = mkWorkadventureSet xce sources.xce "xce";
      xce-unfederated = mkWorkadventureSet xce-unfederated (patchSources sources.xce-unfederated [./xce-unfederated.patch]) "xce-unfederated";
    });
in {
  workadventure-tcm = wapkgs.tcm;
  workadventure-xce = wapkgs.xce;
  workadventure-xce-unfederated = wapkgs.xce-unfederated;
}