Have just reorganized my personal monorepo to be totally based around nix: each package just has a default.nix and .envrc, with latter containing something like: "use flake .#package". The default.nix can be a regular package, npm package, python, common lisp, etc, and can reference anything else in the repo. The only housekeeping in flake.nix is adding lines like:
There are some special considerations around devShells: I don't need inputs on an npm package, for example, or that I want to include the asdf package itself within its own devShell for lisp. Have made a few wrapper funcs like "mkLispDevShell" and "mkNpmDevShell" to handle this.
This isnt perfect I know with all the housekeeping, but it balances itself out in terms of flexibility. For example, I can trivially create a relatively simply "assets" package/derivation that is both just a folder a files assured to be somewhere during a build that needs it, as well as be a simple lisp package that interfaces with those files. And prod builds can become almost entirely nix derivations that have inputs from across the repo and are defined by simple inline scripts: "nix run .#prod-server".
This isnt perfect I know with all the housekeeping, but it balances itself out in terms of flexibility. For example, I can trivially create a relatively simply "assets" package/derivation that is both just a folder a files assured to be somewhere during a build that needs it, as well as be a simple lisp package that interfaces with those files. And prod builds can become almost entirely nix derivations that have inputs from across the repo and are defined by simple inline scripts: "nix run .#prod-server".