Multpile flakes in one repo, `nix flake update` needs to be run even if type: `path`

Hello,

I’m still learning nix(lang|pkg|os). I’m trying to move some of my ansible scripts to nixos flakes.
I have a git repo, with a few flakes inside:
./flake.nix # "root" flake

./servers/hetzner-cloud/flake.nix # generic server flake, used with nixos-anywhere

./clients/client-foobar/flake.nix # client specific server configuration and deployment, used with nixos-rebuild --target-host=...

Root flake includes (in inputs, type path) both hetzner-cloud and client-foobar flakes.
Also client-foobar flake includes hetzner-cloud flake (so it’s self-contained, reuses modules from hetzner-cloud.nixosConfigurations).

What I am trying to achieve is separation between “server setup” (./servers) and “deployment” (./clients).
I will expose cli commands (defined in “sub” flakes) via root flake’s apps or devShells.${system}.packages.

I have couple of questions:

  1. When I update client-foobar or hetzner-cloud flakes (or modules, that those flakes use) - I need to do nix flake update for root flake, otherwise root flake doesn’t “see” changes in “sub” flakes. This also updates all the other inputs of flakes (disko, systems, etc…).
    How can I avoid this? I’ve already hit github’s rate limiter while tinkering :sweat_smile:
    Documentation says that when flake is in git repo then the path type becomes git+file. Which, I assume, reads flake from git repo (not directly from directory). But even if the changes are unstaged - they are picked up after I do nix flake update. So I think something else is going on there,

  2. Is my approach viable?
    Maybe it’s better to have one (root) flake and import a bunch of nix modules into it (./clients/client-foobar.nix, ./servers/hetzner.nix and etc.)? :thinking:

I’ve asked same question on discord and the general gist of answers was “subflakes are problematic, just compartmentalize with modules”.

Which is what I’ll do. But more feedback is always welcome!