about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <git@lukasepple.de>2020-07-22 16:27:53 +0200
committersternenseemann <git@lukasepple.de>2020-07-22 16:50:09 +0200
commitfe821f89b7ea5ab905166ccc5f6e1ab32eeb1842 (patch)
treea213341eb6bd25da7cc1d69d4e8a42bd5113f29a
parent11872a4da6ab14af0c67281075cec1f3f7a7acba (diff)
web/default.nix: get rid of bash dependency
11872a4da6ab14af0c67281075cec1f3f7a7acba removed the {…,…} bash syntax,
so we don't need to set the yarn config anymore.
-rw-r--r--web/default.nix19
1 files changed, 7 insertions, 12 deletions
diff --git a/web/default.nix b/web/default.nix
index ab75d75..c0b6489 100644
--- a/web/default.nix
+++ b/web/default.nix
@@ -1,5 +1,4 @@
-{ stdenv, fetchFromGitHub, callPackage
-, bash, yarn
+{ stdenv, fetchFromGitHub, callPackage, yarn
 , production ? true }:
 
 let
@@ -26,6 +25,7 @@ let
     inherit (pkgInfo) name;
     dependencies = calledTemplate.nodeBuildInputs;
   };
+  yarnFlags = stdenv.lib.escapeShellArgs [ "--offline" "--frozen-lockfile" ];
 
 in
 
@@ -43,21 +43,16 @@ stdenv.mkDerivation rec {
       --replace node_modules "${node_modules}"
   '';
 
+  # make sure vis-network find vis-data
   NODE_PATH = "${node_modules}";
 
   buildPhase = ''
-    # temporary $HOME for yarn config
-    export HOME=$(pwd)/yarn_home
-    mkdir -p $HOME
-    yarn config --offline set script-shell "${bash}/bin/bash"
-
-    # binaries of deps.nix
-    export PATH="${node_modules}/.bin:$PATH"
-
     # browserify won't look in NODE_PATH for modules
+    # due to the symlink yarn will also add node_modules/.bin
+    # to PATH, so we don't have to do it
     ln -s ${node_modules} node_modules
-    yarn run --offline build:assets
-    yarn run --offline build:${target}
+    yarn ${yarnFlags} run build:assets
+    yarn ${yarnFlags} run build:${target}
   '';
 
   installPhase = ''