From 9a5a2ddb9edae94f5e004d22c71215283fa3a653 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Tue, 19 Jan 2021 21:56:19 +0100 Subject: [PATCH] Fix lib parameter propagation --- default.nix | 4 ++-- lib/expressions/CompositionExpression.js | 3 +++ lib/expressions/OutputExpression.js | 1 + node-packages.nix | 2 +- tests/default-v10.nix | 4 ++-- tests/default-v12.nix | 4 ++-- tests/default-v14.nix | 4 ++-- tests/grunt/default.nix | 6 +++--- tests/grunt/node-packages.nix | 2 +- tests/grunt/supplement.nix | 2 +- tests/lockfile-v2/default.nix | 4 ++-- tests/lockfile-v2/node-packages.nix | 2 +- tests/lockfile/default.nix | 4 ++-- tests/lockfile/node-packages.nix | 2 +- tests/node-packages-v10.nix | 2 +- tests/node-packages-v12.nix | 2 +- tests/node-packages-v14.nix | 2 +- tests/scoped/default.nix | 4 ++-- tests/scoped/node-packages.nix | 2 +- 19 files changed, 30 insertions(+), 26 deletions(-) diff --git a/default.nix b/default.nix index 0355851..6f5477d 100644 --- a/default.nix +++ b/default.nix @@ -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; } diff --git a/lib/expressions/CompositionExpression.js b/lib/expressions/CompositionExpression.js index d664ec8..fc60745 100644 --- a/lib/expressions/CompositionExpression.js +++ b/lib/expressions/CompositionExpression.js @@ -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 @@ -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({ @@ -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 diff --git a/lib/expressions/OutputExpression.js b/lib/expressions/OutputExpression.js index cbd144c..0f70697 100644 --- a/lib/expressions/OutputExpression.js +++ b/lib/expressions/OutputExpression.js @@ -41,6 +41,7 @@ OutputExpression.prototype.toNixAST = function() { fetchgit: undefined, "nix-gitignore": undefined, stdenv: undefined, + lib: undefined, globalBuildInputs: [] }, body: new nijs.NixLet({ diff --git a/node-packages.nix b/node-packages.nix index 07859d0..c45319f 100644 --- a/node-packages.nix +++ b/node-packages.nix @@ -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 = { diff --git a/tests/default-v10.nix b/tests/default-v10.nix index f3f9332..81ce881 100644 --- a/tests/default-v10.nix +++ b/tests/default-v10.nix @@ -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; } diff --git a/tests/default-v12.nix b/tests/default-v12.nix index cdd0304..2ddda7e 100644 --- a/tests/default-v12.nix +++ b/tests/default-v12.nix @@ -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; } diff --git a/tests/default-v14.nix b/tests/default-v14.nix index f0ebd11..80e1387 100644 --- a/tests/default-v14.nix +++ b/tests/default-v14.nix @@ -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; } diff --git a/tests/grunt/default.nix b/tests/grunt/default.nix index 4e2a00c..ee2a45d 100644 --- a/tests/grunt/default.nix +++ b/tests/grunt/default.nix @@ -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; } diff --git a/tests/grunt/node-packages.nix b/tests/grunt/node-packages.nix index 219f057..ccdccff 100644 --- a/tests/grunt/node-packages.nix +++ b/tests/grunt/node-packages.nix @@ -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 = { diff --git a/tests/grunt/supplement.nix b/tests/grunt/supplement.nix index 3d3f194..51b4378 100644 --- a/tests/grunt/supplement.nix +++ b/tests/grunt/supplement.nix @@ -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 = { diff --git a/tests/lockfile-v2/default.nix b/tests/lockfile-v2/default.nix index ba0b37a..9e4ab5c 100644 --- a/tests/lockfile-v2/default.nix +++ b/tests/lockfile-v2/default.nix @@ -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; } diff --git a/tests/lockfile-v2/node-packages.nix b/tests/lockfile-v2/node-packages.nix index 01ebcbb..5ee6ffa 100644 --- a/tests/lockfile-v2/node-packages.nix +++ b/tests/lockfile-v2/node-packages.nix @@ -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 = { diff --git a/tests/lockfile/default.nix b/tests/lockfile/default.nix index ba0b37a..9e4ab5c 100644 --- a/tests/lockfile/default.nix +++ b/tests/lockfile/default.nix @@ -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; } diff --git a/tests/lockfile/node-packages.nix b/tests/lockfile/node-packages.nix index 4b0e0c0..cae4993 100644 --- a/tests/lockfile/node-packages.nix +++ b/tests/lockfile/node-packages.nix @@ -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 = { diff --git a/tests/node-packages-v10.nix b/tests/node-packages-v10.nix index 0a89fd3..13d1451 100644 --- a/tests/node-packages-v10.nix +++ b/tests/node-packages-v10.nix @@ -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 = { diff --git a/tests/node-packages-v12.nix b/tests/node-packages-v12.nix index 0a89fd3..13d1451 100644 --- a/tests/node-packages-v12.nix +++ b/tests/node-packages-v12.nix @@ -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 = { diff --git a/tests/node-packages-v14.nix b/tests/node-packages-v14.nix index 0a89fd3..13d1451 100644 --- a/tests/node-packages-v14.nix +++ b/tests/node-packages-v14.nix @@ -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 = { diff --git a/tests/scoped/default.nix b/tests/scoped/default.nix index ba0b37a..9e4ab5c 100644 --- a/tests/scoped/default.nix +++ b/tests/scoped/default.nix @@ -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; } diff --git a/tests/scoped/node-packages.nix b/tests/scoped/node-packages.nix index 82a9e94..47e39be 100644 --- a/tests/scoped/node-packages.nix +++ b/tests/scoped/node-packages.nix @@ -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 = {};