From 6908ecac521c0ddf3d8af75adefa7209f7a8719c Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 9 Mar 2021 15:38:16 +0100 Subject: Added hasi workadventure version wapkgs.nix new contains packages for several different versions of workadventure (so far hasi + thecodingmachine), which can both be used. Unfortunately, this appears to require some weird hacks to convince nix to sort out the dependencies without having to actually duplicate all the packaging code, but it works. --- front/default.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'front/default.nix') diff --git a/front/default.nix b/front/default.nix index d7d9fa6..83ccdf4 100644 --- a/front/default.nix +++ b/front/default.nix @@ -1,4 +1,4 @@ -workadventuresrc: +workadventuresrc: waname: { stdenv , makeWrapper @@ -14,15 +14,13 @@ let in yarn2nix-moretea.mkYarnPackage (rec { - pname = "workadventurefront"; + pname = "workadventurefront-${waname}"; version = "unstable"; + name = pname + "-" + version; - # TODO: perhaps move this into its own file, to make it easily - # replacable across all workadventure packages. src = "${workadventuresrc}/front"; - # NOTE: this is optional and generated dynamically if omitted - yarnNix = ./yarn.nix; + yarnNix = ./. + "/${waname}.nix"; nativeBuildInputs = [ makeWrapper @@ -48,9 +46,9 @@ yarn2nix-moretea.mkYarnPackage buildPhase = '' mkdir -p $out - ln -s ${workadventure.messages.outPath}/generated deps/${pname}/src/Messages/generated + ln -s ${workadventure.messages.outPath}/generated deps/workadventurefront/src/Messages/generated HOME=$TMPDIR yarn --offline run build - cp -r deps/${pname}/dist/ $out/ + cp -r deps/workadventurefront/dist/ $out/ ''; distPhase = ":"; -- cgit v1.2.3