aboutsummaryrefslogtreecommitdiff
path: root/workadventure-nix.nix
blob: ffd028fd478d81121ed52029b3b7015899e29a5b (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
# WorkAdventure packaging effort by SuperSandro2000, not yet upstreamed into nixpkgs.

{ lib, ... }:


let
  pkgs = import <nixpkgs> {};

  src = pkgs.fetchgit {
    url = "https://gitlab.infra4future.de/stuebinm/workadventure-nix";
    rev = "c46949747779b5e679774ceb23a530ed4736c52b";
    sha256 = "1z6qd7bjrc7map2nj3yzwqyvr16vk29fy08pdc9vvd4yid2lywv7";
  };

  # Use a fixed-point operator to build a nixpkgs-like structure that contains all
  # workadventure derivation.
  wapkgs = lib.fix (self: let
    callPackage = lib.callPackageWith (pkgs // self);
  in {
    workadventure-pusher = callPackage "${src}/pusher" {};
    workadventure-back = callPackage "${src}/back" {};
    workadventure-front = callPackage "${src}/front" {};
    workadventure-messages = callPackage "${src}/messages" {};
    workadventure-maps = callPackage "${src}/maps" {};
  });

# Build public attrset of all accessible components.
in rec {
  pusher = wapkgs.workadventure-pusher;
  back = wapkgs.workadventure-back;
  front = wapkgs.workadventure-front;
  maps = wapkgs.workadventure-maps;
}