Skip to content
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

Document overrides #8

Open
woehr opened this issue Nov 23, 2018 · 1 comment
Open

Document overrides #8

woehr opened this issue Nov 23, 2018 · 1 comment

Comments

@woehr
Copy link

woehr commented Nov 23, 2018

In particular, jshint is in my package.json and it fails to build because pnpm2nix tries to download the prebuilt phantomjs rather than using the one in nixpkgs. Is there a way to override the jshint dependency so nixpkgs.phantomjs2 is in its environment when it builds?

builder for '/nix/store/x21ik3i8l78n4srb7w8h2fcki64vwjk2-phantomjs-prebuilt-2.1.16.drv' failed with exit code 1; last 10 log lines:
  npm ERR! errno 1
  npm ERR! [email protected] install: `node install.js`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the [email protected] install script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  npm WARN Local package.json exists, but node_modules missing, did you mean to install?
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /build/.npm/_logs/2018-11-23T15_41_43_961Z-debug.log
cannot build derivation '/nix/store/mjnxay4f5iv0c1vph7sqkmsan1gn3dd6-jshint-2.9.6.drv': 1 dependencies couldn't be built
@adisbladis adisbladis changed the title Packages depending on PhantomJS2 fail to build Document overrides Jul 9, 2019
@adisbladis
Copy link
Member

adisbladis commented Jul 9, 2019

A dependency can be overriden like this:

let
  pnpm2nix = import /path/to/pnpm2nix;
in pnpm2nix.mkPnpmPackage {
  src = ./.;
  overrides = pnpm2nix.defaultPnpmOverrides // {
      phantomjs2 = (drv: drv.overrideAttrs(oldAttrs: {
        buildInputs = oldAttrs.buildInputs ++ [ pkgs.phantomjs ];
      }));
  };
}

All overrides in https://github.com/adisbladis/pnpm2nix/blob/master/overrides.nix are available through pnpm2nix.defaultPnpmOverrides.

Note: I have not tested this particular override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants