aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Bazanski2021-01-01 22:13:39 +0100
committerSerge Bazanski2021-01-01 22:15:34 +0100
commitc5342ed3feda6f6f427fdea65a24f1ac86b3c2cc (patch)
tree694ff2aac9a9ae7c50804d8768c200d6750a9e23
parentbf16458cf15ef38db9c472b71b46a28c4eafafc5 (diff)
Switch to callPackage
-rw-r--r--back/default.nix18
-rw-r--r--default.nix11
-rw-r--r--front/default.nix9
-rw-r--r--maps/default.nix6
-rw-r--r--messages/default.nix18
-rw-r--r--pusher/default.nix21
-rw-r--r--uploader/default.nix9
7 files changed, 72 insertions, 20 deletions
diff --git a/back/default.nix b/back/default.nix
index e634467..5a5a973 100644
--- a/back/default.nix
+++ b/back/default.nix
@@ -1,18 +1,26 @@
-with (import <nixpkgs> { }); let
- workadventure-messages = import ../messages;
+{ stdenv
+, autoPatchelfHook
+, fetchFromGitHub
+, fetchzip
+, makeWrapper
+, nodejs-14_x
+, workadventure-messages
+, yarn2nix-moretea
+, ... }:
+let
node-abi = "83";
- node-grpc-precompiled = pkgs.fetchzip {
+ node-grpc-precompiled = fetchzip {
name = "node-grpc-precompiled-node-${node-abi}";
url = "https://node-precompiled-binaries.grpc.io/grpc/v1.24.4/node-v${node-abi}-linux-x64-glibc.tar.gz";
sha256 = "119rhhk1jpi2vwyim7byq3agacasc4q25c26wyzfmy8vk2ih6ndj";
};
- node-grpc-patched = pkgs.stdenv.mkDerivation {
+ node-grpc-patched = stdenv.mkDerivation {
name = "node-grpc";
buildInputs = [ stdenv.cc.cc ];
- nativeBuildInputs = [ pkgs.autoPatchelfHook ];
+ nativeBuildInputs = [ autoPatchelfHook ];
dontUnpack = true;
# spams console
dontStrip = true;
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..c77e02c
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,11 @@
+with import <nixpkgs> {};
+lib.fix (self: let
+ callPackage = lib.callPackageWith self;
+in pkgs // {
+ workadventure-back = callPackage ./back {};
+ workadventure-pusher = callPackage ./pusher {};
+ workadventure-messages = callPackage ./messages {};
+ workadventure-front = callPackage ./front {};
+ workadventure-uploader = callPackage ./uploader {};
+ workadventure-maps = callPackage ./maps {};
+})
diff --git a/front/default.nix b/front/default.nix
index 786384f..057855e 100644
--- a/front/default.nix
+++ b/front/default.nix
@@ -1,6 +1,9 @@
-with (import <nixpkgs> { }); let
- workadventure-messages = import ../messages;
-in
+{ stdenv
+, fetchFromGitHub
+, makeWrapper
+, workadventure-messages
+, yarn2nix-moretea
+, ... }:
yarn2nix-moretea.mkYarnPackage rec {
pname = "workadventurefront";
version = "unstable";
diff --git a/maps/default.nix b/maps/default.nix
index cf56782..245a8c3 100644
--- a/maps/default.nix
+++ b/maps/default.nix
@@ -1,4 +1,8 @@
-with (import <nixpkgs> { });
+{ stdenv
+, fetchFromGitHub
+, makeWrapper
+, yarn2nix-moretea
+, ... }:
yarn2nix-moretea.mkYarnPackage rec {
pname = "workadventuremaps";
diff --git a/messages/default.nix b/messages/default.nix
index 4b1e734..f397b1d 100644
--- a/messages/default.nix
+++ b/messages/default.nix
@@ -1,14 +1,22 @@
-with (import <nixpkgs> { }); let
- node-protoc-precompiled = pkgs.fetchzip {
+{ stdenv
+, autoPatchelfHook
+, fetchFromGitHub
+, fetchzip
+, gcc-unwrapped
+, yarn2nix-moretea
+, ... }:
+
+let
+ node-protoc-precompiled = fetchzip {
name = "node-protoc-precompiled";
url = "https://node-precompiled-binaries.grpc.io/grpc-tools/v1.10.0/linux-x64.tar.gz";
sha256 = "0dl1anpw3610q58mxf7r9dcp768krwvpa4053cjxn5r8b5xfbh4l";
};
- node-protoc-patched = pkgs.stdenv.mkDerivation {
+ node-protoc-patched = stdenv.mkDerivation {
name = "node-protoc";
- buildInputs = [ pkgs.gcc-unwrapped.lib ];
- nativeBuildInputs = [ pkgs.autoPatchelfHook ];
+ buildInputs = [ gcc-unwrapped.lib ];
+ nativeBuildInputs = [ autoPatchelfHook ];
dontAutoPatchelf = true;
dontUnpack = true;
# protoc: symbol lookup error: /nix/store/...-node-protoc/bin/protoc: undefined symbol: , version
diff --git a/pusher/default.nix b/pusher/default.nix
index 57c1456..a5b84d5 100644
--- a/pusher/default.nix
+++ b/pusher/default.nix
@@ -1,18 +1,29 @@
-with (import <nixpkgs> { }); let
- workadventure-messages = import ../messages;
+{ stdenv
+, autoPatchelfHook
+, makeWrapper
+, fetchzip
+, fetchFromGitHub
+
+, nodejs-14_x
+, yarn2nix-moretea
+
+, workadventure-messages
+}:
+
+let
node-abi = "83";
- node-grpc-precompiled = pkgs.fetchzip {
+ node-grpc-precompiled = fetchzip {
name = "node-grpc-precompiled-node-${node-abi}";
url = "https://node-precompiled-binaries.grpc.io/grpc/v1.24.4/node-v${node-abi}-linux-x64-glibc.tar.gz";
sha256 = "119rhhk1jpi2vwyim7byq3agacasc4q25c26wyzfmy8vk2ih6ndj";
};
- node-grpc-patched = pkgs.stdenv.mkDerivation {
+ node-grpc-patched = stdenv.mkDerivation {
name = "node-grpc";
buildInputs = [ stdenv.cc.cc ];
- nativeBuildInputs = [ pkgs.autoPatchelfHook ];
+ nativeBuildInputs = [ autoPatchelfHook ];
dontUnpack = true;
# spams console
dontStrip = true;
diff --git a/uploader/default.nix b/uploader/default.nix
index 55694c2..a50683b 100644
--- a/uploader/default.nix
+++ b/uploader/default.nix
@@ -1,4 +1,11 @@
-with (import <nixpkgs> { });
+{ stdenv
+, fetchFromGitHub
+, makeWrapper
+, mkYarnPackage
+, nodejs-14_x
+, workadventure-messages
+, yarn2nix-moretea
+, ... }:
yarn2nix-moretea.mkYarnPackage rec {
pname = "workadventureuploader";