{pkgs, ...}: let patchSources = src: patches: pkgs.stdenv.mkDerivation { name = "${src.name}-patched"; inherit patches src; buildPhase = "mkdir -p $out"; installPhase = "cp -r * $out"; }; tcm = pkgs.fetchFromGitHub { owner = "thecodingmachine"; repo = "workadventure"; rev = "4966789b3b3abe8d00362553a827bc9a257ce6d3"; sha256 = "0nq6zg95wsq2ldqhi7w7alvb9krmzrqkgzq0m24cfvpm42agl1xc"; }; fediventure = pkgs.fetchFromGitLab { owner = "fediventure"; repo = "workadventure"; rev = "e769e713c6058efac6959437df6a02da02b8e065"; sha256 = "13243az0b2w69wmbf5z0qnbd9rfixkj61c844c97sy2h136159yd"; }; xce = pkgs.fetchFromGitHub { owner = "workadventure-xce"; repo = "workadventure-xce"; rev = "ba439ca6699a7e5751386d5bed5c44e375e12eb6"; sha256 = "1r6dpn8biisrqij5v2pg1vlifgvv93fnqppyp2l9wzls5am3rx6x"; }; 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 { workadventure-tcm = mkWorkadventureset workadventure-tcm (patchSources tcm [ ./front/tcm.patch ]) "tcm"; workadventure-fediventure = mkWorkadventureset workadventure-fediventure fediventure "fediventure"; workadventure-xce = mkWorkadventureset workadventure-xce (patchSources xce [ ./front/xce.patch ]) "xce"; }); in { workadventure-tcm = wapkgs.workadventure-tcm; workadventure-fediventure = wapkgs.workadventure-fediventure; workadventure-xce = wapkgs.workadventure-xce; }