-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add NPM package set generated by node2nix #16886
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
How to update the NPM packages | ||
============================== | ||
- Install node2nix: | ||
|
||
nix-env -f '<nixpkgs>' -iA node2nix | ||
|
||
- Modify node-packages.json | ||
|
||
- Run the script: | ||
|
||
sh generate.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file has been generated by node2nix 1.0.0. Do not edit! | ||
|
||
{pkgs ? import <nixpkgs> { | ||
inherit system; | ||
}, system ? builtins.currentSystem}: | ||
|
||
let | ||
nodeEnv = import ./node-env.nix { | ||
inherit (pkgs) stdenv python utillinux runCommand writeTextFile; | ||
nodejs = pkgs."nodejs-0_10"; | ||
}; | ||
in | ||
import ./node-packages-v0_10.nix { | ||
inherit (pkgs) fetchurl fetchgit; | ||
inherit nodeEnv; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file has been generated by node2nix 1.0.0. Do not edit! | ||
|
||
{pkgs ? import <nixpkgs> { | ||
inherit system; | ||
}, system ? builtins.currentSystem}: | ||
|
||
let | ||
nodeEnv = import ./node-env.nix { | ||
inherit (pkgs) stdenv python utillinux runCommand writeTextFile nodejs; | ||
}; | ||
in | ||
import ./node-packages-v4.nix { | ||
inherit (pkgs) fetchurl fetchgit; | ||
inherit nodeEnv; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This file has been generated by node2nix 1.0.0. Do not edit! | ||
|
||
{pkgs ? import <nixpkgs> { | ||
inherit system; | ||
}, system ? builtins.currentSystem}: | ||
|
||
let | ||
nodeEnv = import ./node-env.nix { | ||
inherit (pkgs) stdenv python utillinux runCommand writeTextFile; | ||
nodejs = pkgs."nodejs-5_x"; | ||
}; | ||
in | ||
import ./node-packages-v5.nix { | ||
inherit (pkgs) fetchurl fetchgit; | ||
inherit nodeEnv; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{pkgs, system}: | ||
|
||
let | ||
nodePackages = import ./composition-v0_10.nix { | ||
inherit pkgs system; | ||
}; | ||
in | ||
nodePackages // { | ||
node-inspector = nodePackages.node-inspector.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ nodePackages.node-pre-gyp ]; | ||
}); | ||
|
||
phantomjs = nodePackages.phantomjs.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ]; | ||
}); | ||
|
||
webdrvr = nodePackages.webdrvr.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ]; | ||
|
||
preRebuild = '' | ||
mkdir $TMPDIR/webdrvr | ||
|
||
ln -s ${pkgs.fetchurl { | ||
url = "https://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar"; | ||
sha1 = "ef1b5f8ae9c99332f99ba8794988a1d5b974d27b"; | ||
}} $TMPDIR/webdrvr/selenium-server-standalone-2.43.1.jar | ||
ln -s ${pkgs.fetchurl { | ||
url = "http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip"; | ||
sha1 = "26220f7e43ee3c0d714860db61c4d0ecc9bb3d89"; | ||
}} $TMPDIR/webdrvr/chromedriver_linux64.zip | ||
''; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{pkgs, system}: | ||
|
||
let | ||
nodePackages = import ./composition-v4.nix { | ||
inherit pkgs system; | ||
}; | ||
in | ||
nodePackages // { | ||
node-inspector = nodePackages.node-inspector.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ nodePackages.node-pre-gyp ]; | ||
}); | ||
|
||
phantomjs = nodePackages.phantomjs.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ]; | ||
}); | ||
|
||
webdrvr = nodePackages.webdrvr.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ]; | ||
|
||
preRebuild = '' | ||
mkdir $TMPDIR/webdrvr | ||
|
||
ln -s ${pkgs.fetchurl { | ||
url = "https://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar"; | ||
sha1 = "ef1b5f8ae9c99332f99ba8794988a1d5b974d27b"; | ||
}} $TMPDIR/webdrvr/selenium-server-standalone-2.43.1.jar | ||
ln -s ${pkgs.fetchurl { | ||
url = "http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip"; | ||
sha1 = "26220f7e43ee3c0d714860db61c4d0ecc9bb3d89"; | ||
}} $TMPDIR/webdrvr/chromedriver_linux64.zip | ||
''; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{pkgs, system}: | ||
|
||
let | ||
nodePackages = import ./composition-v5.nix { | ||
inherit pkgs system; | ||
}; | ||
in | ||
nodePackages // { | ||
node-inspector = nodePackages.node-inspector.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ nodePackages.node-pre-gyp ]; | ||
}); | ||
|
||
phantomjs = nodePackages.phantomjs.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs2 ]; | ||
}); | ||
|
||
webdrvr = nodePackages.webdrvr.override (oldAttrs: { | ||
buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ]; | ||
|
||
preRebuild = '' | ||
mkdir $TMPDIR/webdrvr | ||
|
||
ln -s ${pkgs.fetchurl { | ||
url = "https://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar"; | ||
sha1 = "ef1b5f8ae9c99332f99ba8794988a1d5b974d27b"; | ||
}} $TMPDIR/webdrvr/selenium-server-standalone-2.43.1.jar | ||
ln -s ${pkgs.fetchurl { | ||
url = "http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip"; | ||
sha1 = "26220f7e43ee3c0d714860db61c4d0ecc9bb3d89"; | ||
}} $TMPDIR/webdrvr/chromedriver_linux64.zip | ||
''; | ||
|
||
dontNpmInstall = true; # We face an error with underscore not found, but the package will work fine if we ignore this. | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh -e | ||
|
||
node2nix -i node-packages.json -o node-packages-v0_10.nix -c composition-v0_10.nix --pkg-name nodejs-0_10 | ||
node2nix -i node-packages.json -o node-packages-v4.nix -c composition-v4.nix | ||
node2nix -5 -i node-packages.json -o node-packages-v5.nix -c composition-v5.nix |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no-flags are very confusing. It's like saying "no = true".
What about using
npmInstall = false
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this is very ugly -- however, what I'm basically doing here is following the conventions the stdenv generic builder uses, e.g. for
stdenv.mkDerivation {}
you can set do* and dont* flags to enable or disable certain steps, e.g.:so it's as nice (or as ugly!) the generic builder is.
Also, in the future I'm planning to create a better structured abstraction function that (for example) uses the generic builder's phases and so on.