diff options
author | Sandro | 2021-01-01 22:48:51 +0100 |
---|---|---|
committer | GitHub | 2021-01-01 22:48:51 +0100 |
commit | 8321fdf6e8235198613434713d80b7028960902d (patch) | |
tree | 694ff2aac9a9ae7c50804d8768c200d6750a9e23 | |
parent | bf16458cf15ef38db9c472b71b46a28c4eafafc5 (diff) | |
parent | c5342ed3feda6f6f427fdea65a24f1ac86b3c2cc (diff) |
Merge pull request #2 from q3k/q3k/callpackage
Switch to callPackage
-rw-r--r-- | back/default.nix | 18 | ||||
-rw-r--r-- | default.nix | 11 | ||||
-rw-r--r-- | front/default.nix | 9 | ||||
-rw-r--r-- | maps/default.nix | 6 | ||||
-rw-r--r-- | messages/default.nix | 18 | ||||
-rw-r--r-- | pusher/default.nix | 21 | ||||
-rw-r--r-- | uploader/default.nix | 9 |
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"; |