I am working on a project (let’s call it WRAPPER
) which consists entirely of APIs and utilites which help with writing code in a specific scientific simulation framework (let’s call it FRAMEWORK
). As such my code is useless without the framework which it enhances.
In case it’s relevant, this is all written in C++, and the framework uses cmake.
For my initial convenience, I started off with a single flake.nix
which installs the simulation framework, the test framework I’m using, some development tools, etc. This has served me well in all manner of use cases during the initial phase of development, during which WRAPPER
, the FRAMEWORK
application which used it, and the client code which used the latter, all lived in the same repository.
Now that I need to distribute WRAPPER
reliably and conveniently for others to use in other contexts, I am wondering how to split my monolithic flake into smaller components which cater for different aspects of WRAPPER
’s use, to get the ability to provide
-
WRAPPER
itself - a development environment for working on
WRAPPER
- everything necessary for testing
WRAPPER
on CI - a development environment for projects that use
WRAPPER
to write applications inFRAMEWORK
- everything needed by users of projects written with
WRAPPER
+FRAMEWORK
, i.e. something that projects in category 4 would provide to their users. - a template for starting projects in category 4
I imagine the following differences between the above
-
3 vs 2
- 3 is probably 2 minus LSP servers, debuggers, profilers etc.
- 2 should use the in-tree
WRAPPER
sources directly; should 3 getWRAPPER
via 1?
-
4 vs 2
- 2 should use the in-tree
WRAPPER
sources directly; 4 should getWRAPPER
via 1 - 4 may need extra dependencies which are irrelevant to 2
- 2 should use the in-tree
-
5
- may need extra dependencies which are irrelevant to the others
- can do without the testing framework which is needed by 2,3 and 4
I strongly suspect that the baggage that I bring from having used the monolithic flake for a while, combined with my patchy grasp of Nix, is preventing me from seeing decent solutions.
I’ll also need this to work on Linux, MacOS with Apple Silicon and WSL2, but that’s probably a second-order issue at this point.
Can you offer any advice on how to organize this?