Activating system modules as part of a dev shell

Is there a method to include the activation of system modules into a dev shell?
I.e. lots of projects require the docker daemon to be enabled, or libvirtd, or some other service.

At the moment I am just enabling these part of my desktop machine config, but if they weren’t already enabled I wouldn’t be able to build these projects without modifying my system config and rebuilding.

I understand that the question may be kinda stupid, modifying stuff like that is quite intrusive.
However, on other linux systems, repositories may include a script which installs and sets-up services instead and I see this as analogous to that.

Also if this is not possible the ordinary way, do flakes have a solution for it instead?

No, what you’re looking for is a container or a vm.

Well, I expected as much

Depending on your services something like devenv.sh might help.

Other than that it might be possible to use oneshot services with devShells.
We do that inside a shell script and then use process-compose (from devenv) to start it.