Skip to content

[discussion] shared yarnPackages.nix to reduce evaluation overhead #83499

@ghost

Description

As @Mic92 described in #78810, the current approach of generating a yarn.nix file for every application is not scalable. We should try to make yarn2nix work with a shared yarnPackages.nix file, while preserving the exact result.
We currently have the following yarn.nix files in nixpkgs:

140473 ./pkgs/development/tools/yarn2nix-moretea/yarn2nix/yarn.nix
444016 ./pkgs/servers/web-apps/codimd/yarn.nix
36480 ./pkgs/applications/networking/instant-messengers/riot/riot-desktop-yarndeps.nix

I will also take into account the mastodon package which is yet to be merged:

445678 pkgs/servers/mastodon/yarn.nix

Now I did some further analysis. All yarn.nix files have a total of 3534 entries, of which 1093 could be saved by merging the files (these are not unique). Assuming all entries are about equal in size, this would shrink the definitions from 1066647 bytes to 736753 bytes, which is a decrease of 31%.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: nodejsNode.js is a free, open-source, cross-platform JavaScript runtime environment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions