aboutsummaryrefslogtreecommitdiff
path: root/wapkgs.nix
blob: 42af7c6f6c4aab4eb7674f627a17b8049fc62d4f (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
{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 = import ./nix/sources.nix {};
  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 {}).overrideAttrs (old: { meta.broken = true; });
          };
    in pkgs // rec {
      tcm = mkWorkadventureSet tcm sources.tcm "tcm";
      xce = mkWorkadventureSet xce sources.xce "xce";
      xce-unfederated = mkWorkadventureSet xce-unfederated sources.xce-unfederated "xce-unfederated";
    });
in {
  workadventure-tcm = wapkgs.tcm;
  workadventure-xce = wapkgs.xce;
  workadventure-xce-unfederated = wapkgs.xce-unfederated;
}