aboutsummaryrefslogtreecommitdiff
path: root/workadventure-nix.nix
diff options
context:
space:
mode:
authorstuebinm2021-02-05 13:31:42 +0100
committerstuebinm2021-02-05 13:36:17 +0100
commit86c56bb9a40425e4567c3648d427ad7e6be01a65 (patch)
tree814908629b856c99dadc32773ad2dec586160cca /workadventure-nix.nix
Functional module, extracted from fediventure repo
(just to make it easier to hack, and remove fediventure-specific deployment logic)
Diffstat (limited to 'workadventure-nix.nix')
-rw-r--r--workadventure-nix.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/workadventure-nix.nix b/workadventure-nix.nix
new file mode 100644
index 0000000..4c515cb
--- /dev/null
+++ b/workadventure-nix.nix
@@ -0,0 +1,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 = "71ed23142c5ab6db05263b6e5c52f8fab1d84425";
+ sha256 = "0g20rzaxp5md26hc3dig4hhp296bd45n1zi3b67a8q0l290ydn2g";
+ };
+
+ # 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;
+}