Open qknight opened 5 years ago
we got it to 'not' recompile using: https://github.com/svanderburg/node2nix/issues/8#issuecomment-432138008
basically edit node-packages.nix
and reference a dummy
folder where we copied the package.json
into.
args = {
name = "nixcloud-monitoring-frontend";
packageName = "nixcloud-monitoring-frontend";
version = "0.0.0";
src = ./dummy;
dependencies = [
(sources."@ember-decorators/argument-0.8.21" // {
dependencies = [
sources."babel-plugin-filter-imports-1.1.2"
sources."ember-cli-version-checker-2.1.2"
];
})
maybe it makes sense to mention this in the README.md
@qknight @pukkamustard when I do this I get a "do not know how to unpack source archive" error. Did you run into that?
Maybe too late, but for others: @paulyoung ./dummy
is a folder, not a file.
@lionello it’s been a while but I’m pretty sure I was using a dummy
directory containing package.json
Since https://github.com/svanderburg/node2nix/pull/199 / https://github.com/svanderburg/node2nix/pull/205 there's a nodeDependencies
exposed that ignores everything but package.json and package-lock.json. Using https://github.com/svanderburg/node2nix/tree/d5ea8f0c2e35257350fb893ad1c27d9ea28e9e8b#using-the-nodejs-environment-in-other-nix-derivations I was able to avoid this unnecessary rebuilding by switching out shell.nodeDependencies
for nodeDependencies
.
short version
we've been using:
node2nix -8 -d -i package.json
to generate:and using these we reference only the
node_modules
with${nodePackages}/lib/node_modules/nixcloud-monitoring-frontend/node_modules
but each time we evaluate this it rebuilds the nodePackages and this takes about 8 minutes.
are we doing something wrong or is that always the case when using node2nix?
long version
nixos-rebuild switch
summary
so far we have been using yarn2nix but as of https://github.com/moretea/yarn2nix/issues/12 we can't use it without fixing
node-sass
.node-sass
has been a show-stopper for a few packages in the past.