Split into different files and use callPackage to build them. Also add them to a 'package' attribute in the flake, to be able to call them outside.