Skip to content

Instantly share code, notes, and snippets.

@manveru
Created June 22, 2016 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manveru/20d22586d9dceae90930be528cbc49ce to your computer and use it in GitHub Desktop.
Save manveru/20d22586d9dceae90930be528cbc49ce to your computer and use it in GitHub Desktop.
use it like $(nix-build npm2nix.nix)/bin/npm2nix -i package.json -d -5 -c npm.nix
with (import <nixpkgs> {});
let
npm2nixRepo = fetchFromGitHub {
owner = "svanderburg";
repo = "npm2nix";
rev = "758b286acfb077051a17aa9579adc558deeebbd4";
sha256 = "0gmvpxvp75fqw7w7x0c1ywc1zghd1hl6iimbv4xnjwlxgh704yg6";
};
npm2nixOut = (import "${npm2nixRepo}/release.nix" {}).package."${builtins.currentSystem}".outPath;
in stdenv.mkDerivation {
name = "npm2nix";
buildInputs = [];
src = npm2nixRepo;
phases = "buildPhase";
buildPhase = ''
mkdir -p $out/bin
ln -s ${npm2nixOut}/bin/npm2nix $out/bin/npm2nix
'';
}
@svanderburg
Copy link

Is this expression used to install npm2nix?

What you can also do for convenience is creating a git clone:

git clone https://github.com/svanderburg/npm2nix.git -b reengineering2

Opening the git folder:

cd npm2nix

And running the following command-line instruction to install it:

nix-env -f default.nix -iA package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment