devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Recommended structure for monorepo?

Open dsalaza4 opened this issue 10 months ago • 1 comments

Hi,

Looking at the documentation, it looks like you recommend using a root-level devenv.nix that provides shells for every project.

When I started playing with this tool I did not think of this approach but rather thought about having a devenv.nix for each project and then cd-ing to it in order to run devenv shell.

What do you folks think is a good structure for using devenv in a monorepo?

Thanks!

dsalaza4 avatar Feb 05 '25 19:02 dsalaza4

Parts are discussed in #1662 and #998 Also have a look at https://devenv.sh/automatic-shell-activation/ to auto-activate the shell automatically on cd.

I am using this setup you described. I have a devenv.nix in each subproject. And for parent-projects I import the subprojects devenv.nix directly (to setup up things like complex devenv up etc)

clotodex avatar Feb 07 '25 20:02 clotodex

Also see https://github.com/cachix/devenv/pull/1841 how to structure sub-environments.

domenkozar avatar Apr 22 '25 15:04 domenkozar

Let's merge this one into #998

domenkozar avatar Jul 28 '25 22:07 domenkozar