devenv
devenv copied to clipboard
Allow recursively finding the devenv.nix in the parent folders inside a monorepo
Hey!
It would be beneficial to be able to start the postgresql server when I'm inside a subfolder in a monorepo:
$ devenv processes up
Error: × File devenv.nix does not exist. To get started, run:
│
│ $ devenv init
│
$ ls -lah ../../devenv*
.rw-r--r-- 2.8k onnimonni 20 Oct 10:39 ../../devenv.lock
.rw-r--r-- 3.6k onnimonni 21 Oct 09:08 ../../devenv.nix
.rw-r--r-- 201 onnimonni 20 Oct 10:38 ../../devenv.yaml
Currently I need to go back to the root folder everytime to run this.
Or would there be another way to achieve this?
Maybe we could crawl up and ask to run it from parent(s) folder. I guess that's better than what we have now. WDYT?
Yeah that would be perfect ☺️
A possible way to do this is to add a script alias to run devenv in the project root:
scripts = {
devenv = {
description = "Alias of devenv command, ran in the project root";
exec = ''
cd "''${DEVENV_ROOT}"
devenv "''${@}"
'';
};
};