diff --git a/default.nix b/default.nix index e4fb6a9..991147d 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,7 @@ let nodeEnv = import ./nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/lib/expressions/CompositionExpression.js b/lib/expressions/CompositionExpression.js index 474ff0d..36d37f5 100644 --- a/lib/expressions/CompositionExpression.js +++ b/lib/expressions/CompositionExpression.js @@ -109,6 +109,7 @@ CompositionExpression.prototype.toNixAST = function() { stdenv: new nijs.NixInherit("pkgs"), lib: new nijs.NixInherit("pkgs"), python2: new nijs.NixInherit("pkgs"), + dos2unix: new nijs.NixInherit("pkgs"), libtool: new nijs.NixIf({ ifExpr: new nijs.NixAttrReference({ attrSetExpr: new nijs.NixExpression("pkgs"), diff --git a/nix/node-env.nix b/nix/node-env.nix index 5dad9ec..8c5b8e0 100644 --- a/nix/node-env.nix +++ b/nix/node-env.nix @@ -1,6 +1,6 @@ # This file originates from node2nix -{lib, stdenv, nodejs, python2, pkgs, libtool, runCommand, writeTextFile, writeShellScript}: +{lib, stdenv, nodejs, python2, pkgs, dos2unix, libtool, runCommand, writeTextFile, writeShellScript}: let # Workaround to cope with utillinux in Nixpkgs 20.09 and util-linux in Nixpkgs master @@ -498,7 +498,7 @@ let in stdenv.mkDerivation ({ name = "${name}${if version == null then "" else "-${version}"}"; - buildInputs = [ tarWrapper python nodejs ] + buildInputs = [ tarWrapper python nodejs dos2unix ] ++ lib.optional (stdenv.isLinux) utillinux ++ lib.optional (stdenv.isDarwin) libtool ++ buildInputs; @@ -535,6 +535,8 @@ let do file="$(readlink -f "$i")" chmod u+rwx "$file" + isScript "$file" || continue + dos2unix "$file" patchShebangs "$file" done fi diff --git a/tests/default-v14.nix b/tests/default-v14.nix index e528025..d5904d0 100644 --- a/tests/default-v14.nix +++ b/tests/default-v14.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/tests/default-v16.nix b/tests/default-v16.nix index 8c1f04a..0c30481 100644 --- a/tests/default-v16.nix +++ b/tests/default-v16.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/tests/grunt/default.nix b/tests/grunt/default.nix index e82a458..d176b1e 100644 --- a/tests/grunt/default.nix +++ b/tests/grunt/default.nix @@ -10,7 +10,7 @@ let inherit (pkgs) stdenv lib nix-gitignore fetchurl fetchgit; }); nodeEnv = import ../../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/tests/lockfile-v2/default.nix b/tests/lockfile-v2/default.nix index 23b68b9..cc805b4 100644 --- a/tests/lockfile-v2/default.nix +++ b/tests/lockfile-v2/default.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/tests/lockfile/default.nix b/tests/lockfile/default.nix index 23b68b9..cc805b4 100644 --- a/tests/lockfile/default.nix +++ b/tests/lockfile/default.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/tests/scoped/default.nix b/tests/scoped/default.nix index 23b68b9..cc805b4 100644 --- a/tests/scoped/default.nix +++ b/tests/scoped/default.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; }; diff --git a/tests/versionless/default.nix b/tests/versionless/default.nix index 23b68b9..cc805b4 100644 --- a/tests/versionless/default.nix +++ b/tests/versionless/default.nix @@ -6,7 +6,7 @@ let nodeEnv = import ../../nix/node-env.nix { - inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; + inherit (pkgs) stdenv lib python2 dos2unix runCommand writeTextFile writeShellScript; inherit pkgs nodejs; libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; };