Modify source files

Hi, I’m trying to split a build.gradle file in different files for every subproject. To avoid Nix to trigger full project recompilation.

The solution I have found is to split the file creating a new derivation, and then use derivation out as source of my project build. Have sense to do in this way?

Or maybe there is a way to modify source files before declare them?

can you show some code?

Finally I get another path.

I create a new build.gradle and convert output derivation to string with readFile. Then I can use the string as a source for new subproject derivation.

This way Im simulating a content-addresed derivation.