Skip to content

Commit

Permalink
Fix lib parameter propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
svanderburg committed Jan 19, 2021
1 parent 4011598 commit 9a5a2dd
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 26 deletions.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ./nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
3 changes: 3 additions & 0 deletions lib/expressions/CompositionExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ CompositionExpression.prototype.toNixAST = function() {
paramExpr: {
nodeEnv: new nijs.NixInherit(),
stdenv: new nijs.NixInherit("pkgs"),
lib: new nijs.NixInherit("pkgs"),
"nix-gitignore": new nijs.NixInherit("pkgs"),
fetchurl: new nijs.NixInherit("pkgs"),
fetchgit: fetchgitAttr
Expand Down Expand Up @@ -106,6 +107,7 @@ CompositionExpression.prototype.toNixAST = function() {
funExpr: new nijs.NixImport(new nijs.NixFile({ value: this.nodeEnvNixPath })),
paramExpr: {
stdenv: new nijs.NixInherit("pkgs"),
lib: new nijs.NixInherit("pkgs"),
python2: new nijs.NixInherit("pkgs"),
libtool: new nijs.NixIf({
ifExpr: new nijs.NixAttrReference({
Expand Down Expand Up @@ -137,6 +139,7 @@ CompositionExpression.prototype.toNixAST = function() {
fetchurl: new nijs.NixInherit("pkgs"),
"nix-gitignore": new nijs.NixInherit("pkgs"),
stdenv: new nijs.NixInherit("pkgs"),
lib: new nijs.NixInherit("pkgs"),
fetchgit: fetchgitAttr,
nodeEnv: new nijs.NixInherit(),
globalBuildInputs: globalBuildInputs ? new nijs.NixInherit() : undefined
Expand Down
1 change: 1 addition & 0 deletions lib/expressions/OutputExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ OutputExpression.prototype.toNixAST = function() {
fetchgit: undefined,
"nix-gitignore": undefined,
stdenv: undefined,
lib: undefined,
globalBuildInputs: []
},
body: new nijs.NixLet({
Expand Down
2 changes: 1 addition & 1 deletion node-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
4 changes: 2 additions & 2 deletions tests/default-v10.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v10.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
4 changes: 2 additions & 2 deletions tests/default-v12.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v12.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
4 changes: 2 additions & 2 deletions tests/default-v14.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages-v14.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
6 changes: 3 additions & 3 deletions tests/grunt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
let
globalBuildInputs = pkgs.lib.attrValues (import ./supplement.nix {
inherit nodeEnv;
inherit (pkgs) stdenv nix-gitignore fetchurl fetchgit;
inherit (pkgs) stdenv lib nix-gitignore fetchurl fetchgit;
});
nodeEnv = import ../../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv globalBuildInputs;
}
2 changes: 1 addition & 1 deletion tests/grunt/node-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
2 changes: 1 addition & 1 deletion tests/grunt/supplement.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
4 changes: 2 additions & 2 deletions tests/lockfile-v2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ../../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
2 changes: 1 addition & 1 deletion tests/lockfile-v2/node-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
4 changes: 2 additions & 2 deletions tests/lockfile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ../../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
2 changes: 1 addition & 1 deletion tests/lockfile/node-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
2 changes: 1 addition & 1 deletion tests/node-packages-v10.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
2 changes: 1 addition & 1 deletion tests/node-packages-v12.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
2 changes: 1 addition & 1 deletion tests/node-packages-v14.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {
Expand Down
4 changes: 2 additions & 2 deletions tests/scoped/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

let
nodeEnv = import ../../nix/node-env.nix {
inherit (pkgs) stdenv python2 runCommand writeTextFile;
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv fetchgit;
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}
2 changes: 1 addition & 1 deletion tests/scoped/node-packages.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file has been generated by node2nix 1.9.0. Do not edit!

{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, globalBuildInputs ? []}:
{nodeEnv, fetchurl, fetchgit, nix-gitignore, stdenv, lib, globalBuildInputs ? []}:

let
sources = {};
Expand Down

0 comments on commit 9a5a2dd

Please sign in to comment.