I have created a POC of this structure in the Github org. Relevant repos:
As a demonstration - you can run nix build github:auxolotl/top-level#javascript.test. The POC consists of 3 repos in the arrangement in @VlinkZ’s diagram.
top-levelconsumes bothpackagesandjavascriptas inputs, andjavascriptonly consumestop-level.javascript’s output contains a function that acceptspackagesas input, and exports thehelloderivation fromtop-level.core(ie. thepackagesflake).top-level’s output contains both the Nixpkgs set frompackages, as well as the function fromjavascript, with thepackagesflake input passed to it to constructjavascript’s package set.
The flakes are pretty barebones, and don’t follow the proper output schema - I just wanted to use this as a quick and dirty POC for now. Obviously, we’d be constructing our flakes a lot nicer than this
In any case, feel free to take a look and let me know your thoughts in the structure!