Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

let
nodeEnv = import ../../../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv python2 util-linux runCommand writeTextFile;
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, pkgs }:
(import ./composition.nix {
(import ./node-composition.nix {
inherit pkgs;
inherit (stdenv.hostPlatform) system;
})."package".override {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p nodePackages.node2nix

node2nix \
--node-env node-env.nix \
--development \
--input package.json \
--output node-packages.nix \
--composition node-composition.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# This file has been generated by node2nix 1.7.0. Do not edit!
# This file has been generated by node2nix 1.8.0. Do not edit!

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:

let
nodeEnv = import ./node-env.nix {
inherit (pkgs) stdenv python2 util-linux runCommand writeTextFile;
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
locpkgs =
in
import ./node-packages.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
globalBuildInputs = [
locpkgs.node-pre-gyp
];
};
in locpkgs
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file originates from node2nix

{stdenv, nodejs, python2, util-linux, libtool, runCommand, writeTextFile}:
{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile}:

let
python = if nodejs ? python then nodejs.python else python2;
Expand Down Expand Up @@ -57,7 +57,7 @@ let

# Recursively composes the dependencies of a package
composePackage = { name, packageName, src, dependencies ? [], ... }@args:
''
builtins.addErrorContext "while evaluating node package '${packageName}'" ''
DIR=$(pwd)
cd $TMPDIR

Expand Down Expand Up @@ -363,7 +363,7 @@ let

npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild

if [ "$dontNpmInstall" != "1" ]
if [ "''${dontNpmInstall-}" != "1" ]
then
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json
Expand Down Expand Up @@ -396,10 +396,12 @@ let
stdenv.mkDerivation ({
name = "node_${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) util-linux
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ buildInputs;

inherit nodejs;

inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall preRebuild unpackPhase buildPhase;

Expand Down Expand Up @@ -468,7 +470,7 @@ let
name = "node-dependencies-${name}-${version}";

buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) util-linux
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ buildInputs;

Expand Down Expand Up @@ -514,7 +516,7 @@ let
stdenv.mkDerivation {
name = "node-shell-${name}-${version}";

buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) util-linux ++ buildInputs;
buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/shell <<EOF
Expand All @@ -528,8 +530,8 @@ let
# Provide the dependencies in a development shell through the NODE_PATH environment variable
inherit nodeDependencies;
shellHook = stdenv.lib.optionalString (dependencies != []) ''
export NODE_PATH=$nodeDependencies/lib/node_modules
export PATH="$nodeDependencies/bin:$PATH"
export NODE_PATH=${nodeDependencies}/lib/node_modules
export PATH="${nodeDependencies}/bin:$PATH"
'';
};
in
Expand Down
Loading