Re: [Nix-dev] Overriding a node package

2015-03-31 Thread Colin Putney
This happens when you have dependencies in package.json that are not
supplied by the dependencies passed to buildNodePackage.

The build process involves running npm, which will read the package.json
file and attempt to download and install any missing dependencies. That
introduces an impurity to the nix build, so buildNodePackage runs npm with
--registry example.com, which causes the download to fail with the sort of
error you encountered.

Once you've got a nix expression that properly supplies all the necessary
dependencies, npm will not attempt any downloads and the build will succeed.

Hope this helps,

Colin

On Mon, Mar 9, 2015 at 6:38 AM, Kirill Elagin  wrote:

> I have a package (`pkgs.keybase-node-client` to be precise) which is
> generated by `nodePackages.buildNodePackage`. I want to install it from my
> local git repo.
>
> I have no idea how node stuff works in nixpkgs (and not in nixpkgs,
> actually), so I tried the obvious thing:
>
> 
>   packageOverrides = pkgs_: {
> keybase-node-client = lib.overrideDerivation pkgs_.keybase-node-client
>   (drv: {
> src = fetchgit {
>   url = "/home/kirrun/proj/keybase/node-client";
>   <...>
> };
>   });
>   };
> 
>
> but this gives me a super-weird error when I try to install it:
>
> 
> replacing old ‘keybase-node-client-0.7.7’
> installing ‘keybase-node-client-0.7.7’
> these derivations will be built:
>   /nix/store/qsdsxcvnmn6hxs4kpi2mymmplwjq5kig-keybase-node-client-0.7.7.drv
> building path(s)
> ‘/nix/store/16pd9zjj1dh9pc2lpij5p5xqji0b88ag-keybase-node-client-0.7.7’
> building
> /nix/store/16pd9zjj1dh9pc2lpij5p5xqji0b88ag-keybase-node-client-0.7.7
> unpacking sources
> unpacking source archive
> /nix/store/m33g6lw3dg6455bqfnshhn73rn8710yz-node-client-7888c0d
> source root is node-client-7888c0d
> patching sources
> configuring
> 'node_modules/iced-coffee-script' ->
> '/nix/store/jhqn9ph542b8fc8ig8akq22sphbpi2ff-iced-coffee-script-1.7.1-g/lib/node_modules/iced-coffee-script'
> <... (more lines like that) ...>
> 'node_modules/request' ->
> '/nix/store/56b058k267wsf5nhb9n7cw89gi4l90km-node-request-2.30.0/lib/node_modules/request'
> building
> npm ERR! registry error parsing json
> npm ERR! SyntaxError: Unexpected token <
> npm ERR! 
> npm ERR! 
> npm ERR! 
> npm ERR! Example Domain
> npm ERR!
> npm ERR! 
> npm ERR! 
> npm ERR! 
> npm ERR! 

Re: [Nix-dev] Overriding a node package

2015-03-27 Thread Marc Weber
Dependencies will be fetched from "npm repository" - thus is questionable
whethere overriding some packages gets the job done at all IMHO.

I don't know/care atm.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Overriding a node package

2015-03-26 Thread Kirill Elagin
But this patch just adds a new package or do I misunderstand something?
Overriding the whole package by a completely new one just to override src =
not awesome.

On Fri, Mar 27, 2015 at 3:43 AM Marc Weber  wrote:

> This patch is outdated, but illustrates what you're looking for:
> https://github.com/MarcWeber/nixpkgs/commit/ad6ec783bb61e80f90d6e6ee9e0b2d
> 026982fbbe
>
> There is npm2nix utility you have to install.
>
> Marc Weber
> ___
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Overriding a node package

2015-03-26 Thread Marc Weber
This patch is outdated, but illustrates what you're looking for:
https://github.com/MarcWeber/nixpkgs/commit/ad6ec783bb61e80f90d6e6ee9e0b2d026982fbbe

There is npm2nix utility you have to install.

Marc Weber
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] Overriding a node package

2015-03-26 Thread Kirill Elagin
Hello? Anyone using Node.js with nixpkgs?

On Mon, Mar 9, 2015 at 4:38 PM Kirill Elagin  wrote:

> I have a package (`pkgs.keybase-node-client` to be precise) which is
> generated by `nodePackages.buildNodePackage`. I want to install it from my
> local git repo.
>
> I have no idea how node stuff works in nixpkgs (and not in nixpkgs,
> actually), so I tried the obvious thing:
>
> 
>   packageOverrides = pkgs_: {
> keybase-node-client = lib.overrideDerivation pkgs_.keybase-node-client
>   (drv: {
> src = fetchgit {
>   url = "/home/kirrun/proj/keybase/node-client";
>   <...>
> };
>   });
>   };
> 
>
> but this gives me a super-weird error when I try to install it:
>
> 
> replacing old ‘keybase-node-client-0.7.7’
> installing ‘keybase-node-client-0.7.7’
> these derivations will be built:
>   /nix/store/qsdsxcvnmn6hxs4kpi2mymmplwjq5kig-keybase-node-client-0.7.7.drv
> building path(s)
> ‘/nix/store/16pd9zjj1dh9pc2lpij5p5xqji0b88ag-keybase-node-client-0.7.7’
> building
> /nix/store/16pd9zjj1dh9pc2lpij5p5xqji0b88ag-keybase-node-client-0.7.7
> unpacking sources
> unpacking source archive
> /nix/store/m33g6lw3dg6455bqfnshhn73rn8710yz-node-client-7888c0d
> source root is node-client-7888c0d
> patching sources
> configuring
> 'node_modules/iced-coffee-script' ->
> '/nix/store/jhqn9ph542b8fc8ig8akq22sphbpi2ff-iced-coffee-script-1.7.1-g/lib/node_modules/iced-coffee-script'
> <... (more lines like that) ...>
> 'node_modules/request' ->
> '/nix/store/56b058k267wsf5nhb9n7cw89gi4l90km-node-request-2.30.0/lib/node_modules/request'
> building
> npm ERR! registry error parsing json
> npm ERR! SyntaxError: Unexpected token <
> npm ERR! 
> npm ERR! 
> npm ERR! 
> npm ERR! Example Domain
> npm ERR!
> npm ERR! 
> npm ERR! 
> npm ERR! 
> npm ERR! 

[Nix-dev] Overriding a node package

2015-03-09 Thread Kirill Elagin
I have a package (`pkgs.keybase-node-client` to be precise) which is
generated by `nodePackages.buildNodePackage`. I want to install it from my
local git repo.

I have no idea how node stuff works in nixpkgs (and not in nixpkgs,
actually), so I tried the obvious thing:


  packageOverrides = pkgs_: {
keybase-node-client = lib.overrideDerivation pkgs_.keybase-node-client
  (drv: {
src = fetchgit {
  url = "/home/kirrun/proj/keybase/node-client";
  <...>
};
  });
  };


but this gives me a super-weird error when I try to install it:


replacing old ‘keybase-node-client-0.7.7’
installing ‘keybase-node-client-0.7.7’
these derivations will be built:
  /nix/store/qsdsxcvnmn6hxs4kpi2mymmplwjq5kig-keybase-node-client-0.7.7.drv
building path(s)
‘/nix/store/16pd9zjj1dh9pc2lpij5p5xqji0b88ag-keybase-node-client-0.7.7’
building
/nix/store/16pd9zjj1dh9pc2lpij5p5xqji0b88ag-keybase-node-client-0.7.7
unpacking sources
unpacking source archive
/nix/store/m33g6lw3dg6455bqfnshhn73rn8710yz-node-client-7888c0d
source root is node-client-7888c0d
patching sources
configuring
'node_modules/iced-coffee-script' ->
'/nix/store/jhqn9ph542b8fc8ig8akq22sphbpi2ff-iced-coffee-script-1.7.1-g/lib/node_modules/iced-coffee-script'
<... (more lines like that) ...>
'node_modules/request' ->
'/nix/store/56b058k267wsf5nhb9n7cw89gi4l90km-node-request-2.30.0/lib/node_modules/request'
building
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR! Example Domain
npm ERR!
npm ERR! 
npm ERR! 
npm ERR! 
npm ERR!