Add mechanism to allow processes in composed imports to run with their relative working directory
At present, any process defined in an imported subproject (such as frontend or backend in the following example) will be run with the cwd (current working directory) of this parent devenv. Some mechanism to allow them to easily run in isolation (from their own directories) or as part of the greater devenv could be valuable.
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
devenv:
url: github:cachix/devenv
imports:
- ./frontend
- ./backend
Currently we have env.DEVENV_ROOT, but ideally we'd also have env.DEVENV_PARENT_DIR (needs a better name) to reflect this.
Does flake-root solve this?
No.
As usual, process-compose solves this, at least partially.
You can explicitly specify the processes.${process-name}.process-compose.working_dir attribute to change the CWD.
This can be done in the "parent" devenv, which already has an idea where that might be.
You still have to do it for all CWD-dependent processes by hand, so it's not optimal.
@domenkozar one more reason to make process-compose the default when the python 1.0 version comes out 🤞
Can you show an example?
See: https://github.com/schemamap/schemamap/pull/10 See commits 2-4.
Alright 1.0 ships with process-compose as the default so hopefully we can make this happen.