Skip to content

Expose cache helpers in passthru for individual packaging#105

Open
the-sun-will-rise-tomorrow wants to merge 1 commit into
stephank:mainfrom
the-sun-will-rise-tomorrow:passthru-cache-helpers
Open

Expose cache helpers in passthru for individual packaging#105
the-sun-will-rise-tomorrow wants to merge 1 commit into
stephank:mainfrom
the-sun-will-rise-tomorrow:passthru-cache-helpers

Conversation

@the-sun-will-rise-tomorrow
Copy link
Copy Markdown
Contributor

When individualNixPackaging is enabled, the generated Nix expression now adds collectCacheScript and cacheDrvs to the project derivation's passthru. Both values reuse the existing mkCacheBuilderForDrvs helper.

Motivation: consumers sometimes want to materialize node_modules (or otherwise run yarn install) inside their own derivations while still relying on the cache derivations emitted by Nixify. Today they have to depend on the entire libexec workspace output, which can easily climb into the gigabytes for large repositories.

Improve this by exposing the script that copies all per-package cache derivations, as well as the underlying cacheDrvs attribute set, so downstream derivations can source the script and populate .yarn/cache without copying the full workspace tree.

When `individualNixPackaging` is enabled, the generated Nix expression
now adds `collectCacheScript` and `cacheDrvs` to the project
derivation's passthru. Both values reuse the existing
`mkCacheBuilderForDrvs` helper.

Motivation: consumers sometimes want to materialize `node_modules` (or
otherwise run `yarn install`) inside their own derivations while still
relying on the cache derivations emitted by Nixify. Today they have to
depend on the entire libexec workspace output, which can easily climb
into the gigabytes for large repositories.

Improve this by exposing the script that copies all per-package cache
derivations, as well as the underlying `cacheDrvs` attribute set, so
downstream derivations can source the script and populate
`.yarn/cache` without copying the full workspace tree.
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

Successfully merging this pull request may close these issues.

1 participant